Y
Hacker News
new
|
ask
|
show
|
jobs
by
JoshTriplett
141 days ago
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.
4 comments
fortuitous-frog
141 days ago
There's a config option for that :)
https://prek.j178.dev/configuration/#default_install_hook_ty...
link
anttihaapala
141 days ago
formatting should definitely be in pre-commit though, otherwise you'll destroy diffs.
link
Marsymars
140 days ago
"pre-commit the tool" supports the pre-push hook (as well as the various other hooks).
link
esafak
141 days ago
Run the light ones on commit, the heavy ones on push.
link