Twitter | Search | |
donavon "quid pro quo" west Jun 8
I hate working on projects with pre-commit hooks! They prevent WIP commits. Use server-side CI tools to ensure code quality. Never trust the client.
Reply Retweet Like
Kent C. Dodds 🧢
Use both! Also you know you can skip them with --no-verify right?
Reply Retweet Like More
Brandon Vandegrift 📌 NYC Jun 8
Replying to @kentcdodds @donavon
This is my preferred method. Using a pre-commit hook makes it so you fail less CI builds, and you can always skip the hook for WIP commits. Even if you do accidentally push a WIP commit, CI will catch it. Best of both worlds!
Reply Retweet Like
Kent C. Dodds 🧢 Jun 8
Replying to @bmv437 @donavon
Having a failure on CI is annoying and requires more context switching to get back to something you moved in from. Seeing the failure before you commit gives quicker feedback that you can address while you're still working with it.
Reply Retweet Like
Jamon Holmgren Jun 8
I used to be solidly with Donavon on this but have come around to preferring precommit hooks. When paired with ’s lint-staged, they’re pretty fast, and I can always no-verify a WIP commit.
Reply Retweet Like
Nick Taylor Jun 8
I find this works really well as well. It's what I put in place on . lint-staged and husky === 💯
Reply Retweet Like
Christopher Hiller Jun 9
Replying to @kentcdodds @donavon
I like using a formatting hook—no linting. linting will fail on CI if it fails. I don’t like precommit hooks that can disallow the commit either. but! you can also create a git alias like ci=‘commit -n’ and there might even be a config to disable verify globally
Reply Retweet Like
Ken Howard Jun 8
Replying to @kentcdodds @donavon
On my team we made our hooks opt-in. `npm run githooks` is a onetime setup for the user.
Reply Retweet Like
Sam Horton Jun 8
Replying to @kentcdodds @donavon
Also, stashes are superior WIP ‘commits’ IMO
Reply Retweet Like
Pawan Gangwani Jun 8
Replying to @kentcdodds @donavon
+1 I prefer git commit -m "feature1 for quick demo' -n I wanted to highlight -n
Reply Retweet Like