mozilla / chronicle

find everything you've ever found
http://mozillachronicle.tumblr.com/
Mozilla Public License 2.0
16 stars 6 forks source link

chore(build): replace precommit-hook with husky for auto linting #339

Closed pdehaan closed 9 years ago

pdehaan commented 9 years ago

Replacing precommit-hook module with husky so we can remove some sketchy automated JSHint logic included in precommit-hook and convert the hook from "pre-commit" to "pre-push". See https://github.com/mozilla/chronicle/issues/322 for some more context.

This doesn't address the core issue of #322 ("git pre-commit linter should only run on files in the git index"), but should give a slight performance bump (if you like to git commit a lot and git push a little).

How do I even?

To install/test this, I recommend cleaning out any existing git hooks in your ./.git/hooks/ directory that may have been set up by precommit-hook before running npm install. The husky npm install will recreate any hooks that it watches (notably "precommit", "prepush", and "postmerge").

jaredhirsch commented 9 years ago

@pdehaan works for me! I guess I can always grunt lint if I want to verify syntax before pushing a given commit. Please rebase, then treat yo self by hitting that green button :-)

pdehaan commented 9 years ago

Rebased and Travis says we're green. Treating myself!