Ruff is a high-performance Python linter and code formatter written in Rust. It consolidates functionality traditionally provided by several separate Python development tools into a single application, reducing the complexity of configuring and maintaining code quality workflows.
The linter examines source code for potential defects, problematic programming practices and violations of coding conventions. Ruff also includes a formatter designed to offer a consistent alternative to Black.
The application is particularly attractive for large projects, where conventional analysis tools can introduce delays into editing and continuous integration workflows. Although Ruff replaces many common linting utilities, its rules and formatting behaviour are not identical to every tool it draws inspiration from.
This is free and open source software.
Key Features
- Implements more than 900 linting rules, including checks inspired by Pyflakes, pycodestyle, isort, pyupgrade and numerous Flake8 plugins.
- Automatically corrects many detected problems, including unused imports, unnecessary expressions and outdated programming patterns.
- Provides a Python code formatter with configurable line length and other formatting settings.
- Includes import sorting without requiring a separate isort installation.
- Uses built-in caching to avoid repeating analysis of unchanged source files.
- Supports hierarchical and cascading configuration through pyproject.toml and dedicated Ruff configuration files.
- Allows individual rules to be selected, ignored or overridden for particular files and directories.
- Provides a language server for editor diagnostics, fixes and formatting.
- Can check Jupyter notebooks and Python code embedded in supported project files.
Website: github.com/astral-sh/ruff
Support:
Developer: Charles Marsh
License: MIT License
Ruff is written in Rust. Learn Rust with our recommended free books and free tutorials.
Related Software
| Python Linters | |
|---|---|
| Ruff | Extremely fast Python linter and code formatter |
| ty | Fast Python type checker |
| Mypy | Static type checker for Python |
| Bandit | Find security issues in Python code |
| Pylint | Static code analyser |
| wemake-python-styleguide | Flake8 plugin |
| Tach | Enforces module dependencies and architectural boundaries |
| pycodestyle | Check Python code against style conventions in PEP 8 |
| Pyflakes | Checks Python source files for errors |
| Vulture | Find dead code |
| Pyrefly | Fast type checker and language server |
| Flake8 | Wrapper around PyFlakes and pycodestyle |
| Beartype | Near-real-time hybrid runtime-static type-checker |
| Radon | Computes various metrics from Python code |
| Pyright | Full-featured, standards-compliant static type checker |
| cython-lint | Lint Cython files |
| basedpyright | Fork of pyright |
| Refurb | Modernize Python codebases |
| Pylama | Code audit tool for Python |
| Prospector | Brings together the functionality of other Python analysis tools |
| deptry | Check for dependency issues |
| Fixit | Highly configurable linting framework |
| complexipy | Measures cognitive complexity in Python code |
| Zuban | High-performance Python type checker and language server |
| Pyroma | Rates how well a Python project compiles |
| pydoclint | Python docstring linter |
| Arid | Fast duplicate code detection for Python projects |
Read our verdict in the software roundup.
| Python Code Formatters | |
|---|---|
| Ruff | Extremely fast Python linter and code formatter |
| YAPF | Python formatter based on clang-format |
| Black | Uncompromising Python code formatter |
| isort | Python utility and library to sort imports |
| autopep8 | Formats Python code to conform to the PEP 8 style guide |
| Darker | Apply black reformatting to Python files |
| Pyink | Python code formatter |
| blue | Somewhat less uncompromising code formatter than black |
| μsort | Sorts import statements |
| eradicate | Remove commented-out code from Python files |
Read our verdict in the software roundup.
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.