black
black copied to clipboard
Fix support for pre-commit versions < 3.2.0
Description
This previous change broke support for versions of pre-commit earlier than 3.2.0.
As far as I can tell, there's no reason not to leave these as commit, merge-commit and push for now. Eventually they will need to be updated, but the current version of pre-commit supports both sets of values.
Checklist - did you ...
- [x] Add an entry in
CHANGES.mdif necessary? - [x] Add / update tests if necessary?
- [x] Add new / update outdated documentation?
As far as I can tell, there's no reason not to leave these as
commit,merge-commitandpushfor now.
Agreed.
the current version of pre-commit supports both sets of values.
True.
Eventually they will need to be updated
Yes, probably sometime in mid-to-late 2024, see https://github.com/psf/black/pull/4067#issuecomment-1822673095
Can this PR be merged soon? I'm keen to get this fix and aren't in a position to update pre-commit in the environment I'm using.
Thanks for the PR! However, this situation seems pretty annoying, since specifying these values sounds like it will just break again with a newer pre-commit in a few months. I think we should just revert https://github.com/psf/black/pull/3940 , afaict users who care about specific stages can just specify that directly in their own config. Does that sound reasonable, @davidculley? Maybe there's some motivation for that change that I'm missing
Also note for anyone currently broken by this, you can try using https://github.com/psf/black-pre-commit-mirror instead. This never received that change, so should still work. It'll also make black like 2x faster :-)
I think we should just revert #3940 , afaict users who care about specific stages can just specify that directly in their own config. Does that sound reasonable, @davidculley? Maybe there's some motivation for that change that I'm missing
Yes, that sounds reasonable to me.