I wish there's a better comparison to other native solutions like lefthook. I assume the builtin hooks is a core differentiator but I'm not sure if this would be useful outside the Python community.
Looks like this is just a clone of pre-commit, with the same general design.
> pre-commit is a framework to run hooks written in many languages, and it manages the language toolchain and dependencies for running the hooks
The “and” here are the main annoyances with pre-commit. It does too many things, which would each be best served by a separate tool.
As a developer working on a project, I already have mechanisms to set up a development environment. Having pre-commit install another copy of the dev environment is redundant, and typically necessitates duplicating dependency declarations too.
I’d much rather see a tool that focuses on running commit hooks, while leaving dependency management to another tool. Most projects already have something in place anyway, since dependencies are necessary for development beyond the scope of pre-commit hooks.
The really useful part of pre-commit is that it: (1) only runs hooks based on file that changed and (2) stashes all unstaged changes and untracked files.
Imho pre-commit is an antipattern. It tends to break (or rather the janky things it typically runs break) but more importantly whatever needs to be run to gate commits has to be run server-side anyway (people disable precommit, it sometimes produces false negatives, so can't be relied upon). So once you're running the checks server side now you have a second problem which is that the two checks don't always produce the same result. Better to enforce checks in CI, but also provide a way for the dev to run the same check themselves, manually.
Slow feedback loops are an antipattern. Do you like waiting 5 minutes for your checks to run on a separate computer that reports to a separate interface that you then have to navigate to and inspect the error and pull it back into your dev environment to fix? It’s soo much better running locally in 20 seconds and knowing your shit will pass or exactly where the problem is
We've had sudo re-engineered in rust that had security problems, coreutils re-engineered in rust that had bugs, cloudflare re-engineered in rust that broke half the web, surely this one...
10 comments
[ 2.9 ms ] story [ 19.8 ms ] thread> pre-commit is a framework to run hooks written in many languages, and it manages the language toolchain and dependencies for running the hooks
The “and” here are the main annoyances with pre-commit. It does too many things, which would each be best served by a separate tool.
As a developer working on a project, I already have mechanisms to set up a development environment. Having pre-commit install another copy of the dev environment is redundant, and typically necessitates duplicating dependency declarations too.
I’d much rather see a tool that focuses on running commit hooks, while leaving dependency management to another tool. Most projects already have something in place anyway, since dependencies are necessary for development beyond the scope of pre-commit hooks.
The really useful part of pre-commit is that it: (1) only runs hooks based on file that changed and (2) stashes all unstaged changes and untracked files.
For me, I would say the most intriguing feature is no Python dependencies.
https://github.com/evilmartians/lefthook