logoalt Hacker News

sethops1today at 12:15 PM5 repliesview on HN

> what workflows have worked best for you to get everyone to run the hooks

By running the linters and any other checks on CI instead.


Replies

jayd16today at 2:46 PM

Why waste a round trip, build time, loss of flow and CI machine queue wait time when you can catch things early?

CI should also run all the checks but CI checks are not a replacement for local hooks. LFS and things like it can't be implemented as remote CI checks.

Why are we acting like a James Bond villain, slowly lowering the changes into the vat of sharks after we've left the room? I want the hooks. Can we talk about making that easy, assuming some people want them?

show 2 replies
baqtoday at 12:18 PM

autoformatter and autofix linter results can be committed and pushed by CI into the PR branch itself. this is a pain sometimes, but as a repo owner it should protect your sanity.

show 2 replies
ufotoday at 12:45 PM

We do run the linter on CI as well, but I think our comitters would get faster feedback if they ran those checks locally.

show 2 replies
IshKebabtoday at 12:39 PM

As well, not instead. Just add `pre-commit run -a` to your CI. Job done.

It's still annoying for new contributors though because they might not know how to set up pre-commit (which was quite a pain until recently because it's written in Python).

show 1 reply
locknitpickertoday at 4:27 PM

> By running the linters and any other checks on CI instead.

Running linters on CI is an antipattern if there was ever one. That and configuring pipeline runs to fail for linting issues.

Sometimes some people just want to create their own problems. Configuring the editor solves most of the problems, and hooks add a failsafe. Once the code is committed, it should be immutable.