Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend tooling suite to run on Python code for better code quality and consistency #383

Open
AntoineRondelet opened this issue Jun 23, 2021 · 1 comment
Labels
code-quality Task related to the code quality (refactor, enhancements etc.) python Task related to the Python part of the code base tooling Task related to the tooling used in the repository

Comments

@AntoineRondelet
Copy link
Contributor

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

@AntoineRondelet AntoineRondelet added code-quality Task related to the code quality (refactor, enhancements etc.) python Task related to the Python part of the code base tooling Task related to the tooling used in the repository labels Jun 23, 2021
@AntoineRondelet
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-quality Task related to the code quality (refactor, enhancements etc.) python Task related to the Python part of the code base tooling Task related to the tooling used in the repository
Projects
None yet
Development

No branches or pull requests

1 participant