Linting
See
here for an example configuration
for some of these.
Name
Short description
🚦
prek
A rust-powered improvement on pre-commit. Known for its friendlier community and feature rich implementation.
Best
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.
Good
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.
Best
ruff
A fast linter which incorporates a range of other linters. Notably isort can be included as a ruff rule (which we recommend).
Best
toml-sort
Sorts TOML files which are now part of PEP 8.
Best
autopep8
Formatter which conforms to PEP 8.
Good
black
Opinionated formatter, defaults to 88 characters per line. Widely used, but we now recommend ruff-format in its place.
Good
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.
Good
pycodestyle
Linter which checks for errors.
Good
pyflakes
Linter which checks for errors.
Good
pylint
Linter which checks for errors.
Good
sourcery
An AI code reviewer which simplifies code, has a free version but can pay for fancier features.
Good
yapf
Google formatter.
Good
flake8
Linter which complains if code doesn’t follow a rule. Does not support modern pyproject.toml configuration.
Avoid
Type checking
Name
Short description
🚦
ty
Static type checker, fast and rapidly developing.
Best
mypy
Static type checker, won’t fail if no typing but will if typing is incorrect.
Good
Dependency checking
Name
Short description
🚦
deptry
Checks for unused dependencies and undeclared dependencies.
Good
fawltydeps
Checks for unused dependencies and undeclared dependencies.
Good
pip-check-reqs
Checks requirements file (requires converting pyproject.toml).
Good