Coding

Ruff – extremely fast Python linter and code formatter

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
RuffExtremely fast Python linter and code formatter
tyFast Python type checker
MypyStatic type checker for Python
BanditFind security issues in Python code
PylintStatic code analyser
wemake-python-styleguideFlake8 plugin
TachEnforces module dependencies and architectural boundaries
pycodestyleCheck Python code against style conventions in PEP 8
PyflakesChecks Python source files for errors
VultureFind dead code
PyreflyFast type checker and language server
Flake8Wrapper around PyFlakes and pycodestyle
BeartypeNear-real-time hybrid runtime-static type-checker
RadonComputes various metrics from Python code
PyrightFull-featured, standards-compliant static type checker
cython-lintLint Cython files
basedpyrightFork of pyright
RefurbModernize Python codebases
PylamaCode audit tool for Python
ProspectorBrings together the functionality of other Python analysis tools
deptryCheck for dependency issues
FixitHighly configurable linting framework
complexipyMeasures cognitive complexity in Python code
ZubanHigh-performance Python type checker and language server
PyromaRates how well a Python project compiles
pydoclintPython docstring linter
AridFast duplicate code detection for Python projects

Read our verdict in the software roundup.

Python Code Formatters
RuffExtremely fast Python linter and code formatter
YAPFPython formatter based on clang-format
BlackUncompromising Python code formatter
isortPython utility and library to sort imports
autopep8Formats Python code to conform to the PEP 8 style guide
DarkerApply black reformatting to Python files
PyinkPython code formatter
blueSomewhat less uncompromising code formatter than black
μsortSorts import statements
eradicateRemove commented-out code from Python files

Read our verdict in the software roundup.


Best Free and Open Source Software 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.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted