Page MenuHomePhabricator

[lint] replace autopep8 with black (test/functional/abc-*)

Authored by PiRK on Wed, May 10, 08:46.


Group Reviewers
Restricted Project
rABC87ab57fe9f4c: [lint] replace autopep8 with black (test/functional/abc-*)

Add a new linter to run black on python files, and start applying it to some files. Remove these files from autopep8. The end goal is to entirely remove autopep8.

Some doc about black:

The --experimental-string-processing makes black split long strings into multiple lines. This seems important to me as not setting it would do the opposite: put the strings we already split back on a single line.

The flake8 E203 error code is incompatible with black, and not PEP8 compliant, so exclude it.

Test Plan

arc lint -- test/functional

test/functional/ abc-*

Diff Detail

rABC Bitcoin ABC
Lint Not Applicable
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Wed, May 10, 08:46
PiRK edited the summary of this revision. (Show Details)

use triple quotes for docstring as per PEP257

This is not enforced by black, unfortunately.

Fabien requested changes to this revision.Wed, May 10, 09:33
Fabien added a subscriber: Fabien.

You need to add black to:

  • The CI install script
  • The CONTRIBUTING document
4 ↗(On Diff #40245)

I don't think so

This revision now requires changes to proceed.Wed, May 10, 09:33

add black to and, fix comment in linter

This revision is now accepted and ready to land.Wed, May 10, 11:43