Rationale
We use
Ruff to lint and format Python source code. Ruff allows us to achieve the following
:
- Lint Python files in an extremely fast fashion with hundreds of rules inherited from other linters like pyflakes, flake8, pylint, among others. Such rules were reimplemented using Rust.
- Format Python files based on Black rules for consistency
- Cache already-reviewed files for performance
- Integrate in-editor linting and formatting using its VS Code extension for development experience
Alternatives
Below are alternatives we have used in the past and were replaced by Ruff.
Prospector
- Prospector is a meta-linter that incorporates other linters like pylint, pycodestyle and McCabe complexity.
- It does not do anything else besides incorporating external linters in a unified interface.
- It supports less rules when compared to Ruff and does not support formatting.
- It is much slower compared to Ruff.
- It does not provide any formatting capabilities.
- It does not seem to provide caching mechanisms.
- It does not have an official VS Code extension.
Prospector was last reviewed on Jan 28, 2025.