Separate the tools and conventions sections authored by juga's avatar juga
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
------------
Conventions and tools we use
----------------------------
(here go the tools we actually want to use which we should slowly enforce in new MRs etc.)
Style
"""""
About code style and which tools to use to automatically test style and/or fix
it.
Conventions:
- [PEP 8 -- Style Guide for Python Code](https://www.python.org/dev/peps/pep-0008/)
- [PEP 257 -- Docstring Conventions](https://www.python.org/dev/peps/pep-0257/)
- [PEP 287 -- reStructuredText Docstring Format](https://www.python.org/dev/peps/pep-0287/)
Tools to check and/or fix style
-------------------------------
Tools to use to automatically test style and/or fix it.
- [editorconfig](https://editorconfig.org/): helps maintain consistent coding
styles for multiple developers working on the same project across various
......@@ -23,10 +22,22 @@ Tools to check and/or fix style
- [flake8](https://flake8.pycqa.org/en/latest/): mostly follows PEP8, linter.
- [flake8-docstring](https://pypi.org/project/flake8-docstrings/):
follows PEP257.
Other conventions and tools
---------------------------
Style
"""""
- [isort](https://pycqa.github.io/isort/): sort imports alphabetically and
automatically separated into sections and by type.
- in Emacs:
- [elpy](https://github.com/jorgenschaefer/elpy/) can run flake8 or black checks automatically (or manually)
- [flycheck](https://www.flycheck.org/en/latest/) can warn you, "on the fly", about style issues in Python
https://realpython.com/python-code-quality/
https://firefox-source-docs.mozilla.org/code-quality/index.html
Other tools: https://realpython.com/python-code-quality/
\ No newline at end of file