Ruff
A very fast Python linter and formatter: ruff check finds likely mistakes and ruff format lays out code in the Black style.
In more detail
It combines checks from many older tools, such as unused imports, undefined names and style problems, and can fix many of them with --fix. It is installed with pip or pipx and configured in pyproject.toml.
Example
ruff check .
ruff format .Related terms
- linter — A tool that reads code or configuration without running it and flags likely mistakes and style problems.
- code formatter — A tool that rewrites source code into a consistent layout, such as indentation and spacing, without changing what it does.
- Black — A widely used Python code formatter that rewrites files into a single fixed style with almost no options.
Taught in
- Installing Python On Linux — Hands-on Python: Complete Video Course & Book
- Formatting, Linting And Style — Hands-on Python: Complete Video Course & Book