zeth
zeth copied to clipboard
Extend tooling suite to run on Python code for better code quality and consistency
For now, we use several tools on the python code, namely: mypy, flake8 and pylint.
Other tools such as:
Could nicely complement the existing python tool-kit to improve code quality/robustness and consistency in the Zeth client
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
.flake8file (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
.flake8file 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.