ruff

Contents

ruff#

Ruff is a Python linter implemented in the Rust programming language. Even though it is a relatively young project, it has become popular because it’s very fast and incorporates over 600 linting rules. It can therefore be used as full replacement for several other tools, including flake8 and pydocstyle.

Usage#

Use the ruff check command to lint a given file or project directory.

$ ruff check some_file.py
$ ruff check .

Use the pyproject.toml settings to customize the linting rules.

[tool.ruff]
line-length = 100
select = ["E", "F", "D"]  # include pydocstyle "D" rules
ignore = ["D107", "D301"]

[tool.ruff.pydocstyle]
convention = "pep257"