4 ms·
> 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
by fivea 5y ago
> 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.
- claytonjy 5y agoThe 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.