3 ms·
Black is an interesting example because you want two different commands in your pre-commit versus CI/CD, at least in my estimation. In pre-commit you want to r
by WorldMaker 5y ago
Black is an interesting example because you want two different commands in your pre-commit versus CI/CD, at least in my estimation.
In pre-commit you want to run Black in full formatter mode on the staged files. (VS Code's "Format After Save" does most of the work already, but every now and then it slips on something.) In CI/CD you want the check that formatting occurred and block it as a failed test. Those are different commands.
For what it is worth, I was evaluating lint-staged [1] and husky [2] for my pre-commit hooks.
[1] https://github.com/okonet/lint-staged https://github.com/okonet/lint-staged
[2] https://github.com/typicode/husky https://github.com/typicode/husky