Page MenuHomePhabricator

[lint] remove the --preview flag when running black
ClosedPublic

Authored by PiRK on Jul 20 2023, 14:01.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCa5d12e2da629: [lint] remove the --preview flag when running black
Summary

I thought using the --preview flag would make the future transition from black 23.X to 24.X smoother, but unfortunately it is not as stable as I imagined. There is no guarantee that the result of running the linter with this flag will not change on minor upgrade, as we just saw with black 23.7.0 reverting a rule for string formatting (https://github.com/psf/black/pull/3640).

The result in this diff was obtained in two steps:

  • adopt the latest expected future style for multiline concatatenated strings, by first running arc lint --everything after upgrading black to 23.7.0
  • remove the --preview flag from .arclint, and rerun arc lint --everything

The second step does not revert the first one because manually splitting long strings over multiple lines is already compatible with black 23.X (it just won't do it automatically for you).

Test Plan

check we get the same result for all 23.X versions:

pip index versions black
for version in 23.1.0 23.3.0 23.7.0
do
    pip install black==${version}
    arc lint --everything
done

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK edited the summary of this revision. (Show Details)

also undo the parenthesized multiline-strings that would otherwise have to be done on the next major upgrade.

PiRK published this revision for review.Jul 20 2023, 14:36
PiRK edited the summary of this revision. (Show Details)
Fabien added a subscriber: Fabien.

It was much better before, hopefully this will be fixed in the next major with no experimental flag

This revision is now accepted and ready to land.Jul 20 2023, 15:34