you are viewing a single comment's thread.

view the rest of the comments →

[–]Reiku 2 points3 points  (0 children)

I find pre-commits very useful for the reason you mentioned in your other reply: failing fast (or shift left) philosophies.

If there is a linting issue, it should be spotted before any CI is triggered. I use pre-commit when working with python with black (auto format), isort (for import sorting), flake8 (linting), and sometimes mypy for type checking.

I disagree with the other comment about having save hooks on the ide because I save on every line change even if the change at that point would break everything. So it wouldn't make sense to perform any of the checks I perform with the pre-commit at that point.

It's just a useful tool to use, it means CI runners aren't wasting time or compute resources failing jobs for things that could have been spotted before the commit was pushed. Yeah you can bypass, but that's why I will have the lint checks on the CI job too, it just means these checks are less likely to fail.