Ruff
Ruff is a fast linter and code formatter for Python that unifies linting and formatting in one CLI.
Installation and Setup
Ruff is available on PyPI and as a standalone installer. In macOS, it can also be installed from Homebrew:
Key Features
- Lints and formats with a single tool and offers a Black compatible formatter available as
ruff format. - Large built in ruleset that covers many flake8 plugins and common style checks.
- Very fast execution with caching and parallel analysis.
- Flexible configuration through
pyproject.toml,ruff.toml, or.ruff.toml. - Smooth integration with pre commit and GitHub Actions.
Usage
Lint the current directory:
$ ruff check .
Apply automatic fixes during linting:
$ ruff check . --fix
Format code:
$ ruff format .
Related Resources
Tutorial
Ruff: A Modern Python Linter for Error-Free and Maintainable Code
Ruff is an extremely fast, modern linter with a simple interface, making it straightforward to use. It also aims to be a drop-in replacement for other linting and formatting tools, like Pylint, isort, and Black. It's no surprise it's quickly becoming one of the most popular Python linters.
For additional information on related topics, take a look at the following resources:
- Modern Python Linting With Ruff (Course)
- Ruff: A Modern Python Linter (Quiz)
By Leodanis Pozo Ramos • Updated Dec. 1, 2025