Linting

See here for an example configuration for some of these.

Code formatting

Name Short description 🚦
pre-commit Universal tool which performs a git hook on commit, allows you to run linters/formatters on any code. A tool to automatically run many of the tools listed below. 🟢
ruff-format A drop-in replacement for black (and also super fast). A nice “no-need to think” code formatter. If you have your own opinions about code style, you might not like this. 🟢
ruff A fast linter which incorporates a range of other linters. Notably isort can be included as a ruff rule (which we recommend). 🟢
toml-sort Sorts TOML files which are now part of PEP 8. 🟢
autopep8 Formatter which conforms to PEP 8. 🟠
black Opinionated formatter, defaults to 88 characters per line. Widely used, but we now recommend ruff-format in its place. 🟠
isort Sorts imports alphabetically, splits into first/third party, works on python & cython code. We recommend this, but it can be included in ruff, which is simpler. 🟠
pycodestyle Linter which checks for errors. 🟠
pyflakes Linter which checks for errors. 🟠
pylint Linter which checks for errors. 🟠
sourcery An AI code reviewer which simplifies code, has a free version but can pay for fancier features. 🟠
yapf Google formatter. 🟠
flake8 Linter which complains if code doesn’t follow a rule. Does not support modern pyproject.toml configuration. 🔴

Type checking

Name Short description 🚦
mypy Static type checker, won’t fail if no typing but will if typing is incorrect. 🟢