Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
JoshTriplett
· 10mo ago · 0 comments
I think there's value in git hooks, but pre-commit is the wrong hook. This belongs in a hook that runs on attempted push, not on commit.
Comments
[–]
fortuitous-frog
10mo ago
There's a config option for that :)
https://prek.j178.dev/configuration/#default_install_hook_ty...
[–]
anttihaapala
10mo ago
formatting should definitely be in pre-commit though, otherwise you'll destroy diffs.
[–]
Marsymars
10mo ago
"pre-commit the tool" supports the pre-push hook (as well as the various other hooks).
[–]
esafak
10mo ago
Run the light ones on commit, the heavy ones on push.