-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pre-commit/black is getting in the way too much #6877
Comments
This comment has been minimized.
This comment has been minimized.
As far as I know `pre-commit` does not have a switch to skip/exclude a "hook", and it should not cause CI to fail - flake8 is enough for this. Ref: pytest-dev#6877
I think this magic comma will be fixed in psf/black#1288, but you could ask there to double check. |
i consider black a integral part of keeping certain review overheads low, |
@hugovk the issue is older already (psf/black#1010). (FWIW I agree with using black in general, and often use it manually. I've disabled pre-commit myself for now (making git-commit snappy again), and will see how that goes - since there is a distinct "lint" job on CI where black gets run, it's easy to spot/fix anything missed then. And yes, I am aware of |
Definitely 👎 on removing black. |
Started with not enforcing pre-commit [1], but then also merged "short" and "long" version. 1: pytest-dev#6877
Started with not enforcing pre-commit [1], but then also merged "short" and "long" version. 1: pytest-dev#6877
@nicoddemus sorry, you've missed the point (again) - this was not about removing black, but only not making it mandatory via pre-commit etc. See the refs above. |
Sure, sorry, but either way you are definitely free to uninstall pre-commit and run |
Started with not enforcing pre-commit [1], but then also merged "short" and "long" version. 1: pytest-dev#6877
Started with not enforcing pre-commit [1], but then also merged "short" and "long" version. 1: pytest-dev#6877
Started with not enforcing pre-commit [1], but then also merged "short" and "long" version. 1: pytest-dev#6877
It is annoying to get interrupted with something like:
to see that black did turn it into something less readable (since it does
not recognize "exploding commas" with function calls):
Therefore I think it would be more sensible to either exclude black from the
pre-commit config altogether, or not to recommend installing pre-commit in the first place.
I think it is fine to enforce checks on CI, but that could/should be limited to
flake8 etc only, and black could be run then in the release process.
Black is meant to have consistent output for things being committed, but it does not help if you have to add
# fmt: {on,off}
(after being interrupted), or just accept that it is less readable etc.I.e. in the second case it certainly causes code to be less readable / and more affected to diff churn (when tests get hardened/changed with regard to their output).
The text was updated successfully, but these errors were encountered: