Welcome to the Python guidelines we use for network-health code. Below is a list of tools we use when working on network-health code and some additional tools that could help with Python code.
Tools we use
(here go the tools we actually want to use which we should slowly enforce in new MRs etc.)
About code style and which tools to use to automatically test style and/or fix it.
- PEP 8 -- Style Guide for Python Code
- PEP 257 -- Docstring Conventions
- PEP 287 -- reStructuredText Docstring Format
Tools to check and/or fix style
- editorconfig: helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs.
- Black: mostly follows PEP8, automatic formatter, smallest diffs possible.
- flake8: mostly follows PEP8, linter.
- flake8-docstring: follows PEP257.
- isort: sort imports alphabetically and automatically separated into sections and by type.
- in Emacs:
Other tools: https://realpython.com/python-code-quality/