News for hackers. Stuff that matters.
Re:Pre-commit: framework for managing/maintaining multi-lang... by fivea on Tuesday December 21, 2021 @09:41AM (#29637761)
> So now I have two different black calls: in the pre-commit hook and in the CI/CD. And they must be of the same version.

What's the problem, exactly? I worked on projects which enforced precommit hooks running unit tests, and all the precommit and CICD test stages did was run the tests that were already in the repo.

Also, I don't understand what would be the problem of calling out-of-synch tests in precommit hooks and the CICD, given that precommit tests are used as a failsafe to not block the pipeline with broken commits.

Re:Pre-commit: framework for managing/maintaining multi-lang... by claytonjy on Tuesday December 21, 2021 @10:08AM (#29638052)
The problem is if you use the recommended hooks, pulling from the tool's GitHub repo, that runs off a different venv than the rest of your project. If you leave e.g. black out of your dependencies, and only ever run it with pre-commit, there's not really an issue. I prefer to have everything managed in one place, with black as a dev dependency (I use poetry) so I never use the upstream-maintained hooks, I have to write my own.