black icon indicating copy to clipboard operation
black copied to clipboard

Fix support for pre-commit versions < 3.2.0

Open andrewmwilson opened this issue 2 years ago • 5 comments
trafficstars

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.md if necessary?
  • [x] Add / update tests if necessary?
  • [x] Add new / update outdated documentation?

andrewmwilson avatar Nov 13 '23 01:11 andrewmwilson

As far as I can tell, there's no reason not to leave these as commit, merge-commit and push for 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

davidculley avatar Nov 22 '23 12:11 davidculley

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.

owenlamont avatar Dec 20 '23 21:12 owenlamont

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

hauntsaninja avatar Dec 29 '23 09:12 hauntsaninja

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 :-)

hauntsaninja avatar Dec 29 '23 09:12 hauntsaninja

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.

davidculley avatar Dec 29 '23 22:12 davidculley