Speed up Python code checks by over 100x to keep your workflow uninterrupted
Ruff is a tool that finds syntax errors and style issues in Python code and formats it. It combines linters and formatters that were previously installed separately into one, creating a faster and simpler development environment.
Why combine multiple tools into one
Python development typically involved using multiple tools like Flake8, Black, and isort together to ensure code quality. However, the execution time of each tool added up, increasing the wait time for developers every time they modified code. Ruff integrates the functions of these tools into a single program. Written in Rust, it runs 10 to 100 times faster than existing tools. This makes it easy to run checks every time you save code in a local development environment or execute them automatically before committing, without any burden.
Over 900 rules and automatic fixes
Ruff provides over 900 built-in rules.
- Integrated checking It handles the functions of Flake8, isort, Black, pydocstyle, pyupgrade, and autoflake with a single command.
- Automatic fixes It automatically fixes specific errors, such as removing unused imports.
- Configuration management Configuration is managed through
pyproject.toml,ruff.toml, and.ruff.tomlfiles, and hierarchical configuration is supported even in monorepo environments.
Installation and execution
Ruff is distributed on PyPI under the name ruff and can be installed via various package managers such as pip, pipx, and uv. The command uvx ruff@0.17.4 check inspects all files in the current directory, while uvx ruff@0.17.4 format formats the code. It can also be used via editor extensions like VS Code and easily integrated into CI/CD pipelines through GitHub Action. It can also be set up as a pre-commit hook to run checks automatically before committing.
Validation in real projects
Ruff is actively used in major open-source projects such as Apache Airflow, FastAPI, Pandas, and SciPy. The creator of FastAPI stated that it is so fast that they intentionally introduced bugs to verify if the code was actually being checked. A co-founder of Bokeh reported that it is 150 to 200 times faster than Flake8 and takes 0.2 seconds to scan the entire repository. These cases show that Ruff provides practical speed even in large-scale projects.
Things to check before adoption
Ruff is distributed under the MIT license and is compatible with Python 3.15. Since existing Flake8 plugins or specific Black settings may differ from Ruff's default behavior, you should compare your existing settings with Ruff's default rules before applying it to your project. In particular, style-related rules are excluded from the default settings to avoid duplication with formatters, so you may need to adjust the configuration file directly to maintain your desired style. Since active development is ongoing, it is recommended to periodically check for changes in the latest version.