Extend tooling suite to run on Python code for better code quality and consistency
Opened this issue · 1 comments
AntoineRondelet commented
AntoineRondelet commented
Following up on that, Black is a pretty good tool for code formatting (and covers pretty much the functionalities of Yapf).
Using Black, not simply to check the code formatting but also, to format the code would be very handy in our Python projects (like the Zeth client). To do so, we need to:
- Align the line length to Black's default one of 88 in the
.flake8
file (or simply force Black to operate on smaller lines) - We may also want to ignore E501 and E203 errors and instead use BugBear warnings (https://github.com/PyCQA/flake8-bugbear#list-of-warnings) like B950. This can be done by extending the
.flake8
file as follows:
ignore = E501
select = C,E,F,W,B,B901
See: https://github.com/PyCQA/flake8-bugbear#how-to-enable-opinionated-warnings for reference.