Ruff v0.16.0 – Significant new updates – 413 default rules up from 59

Ruff v0.16.0 introduces a major update by enabling 413 default linting rules up from 59, along with support for formatting Python code blocks embedded in Markdown files and flexible new suppression comment syntaxes.
Ruff v0.16.0 is available now! Install it from PyPI, or with your package manager of choice:
uv tool install ruff@latest
As a reminder: Ruff is an extremely fast Python linter and formatter, written in Rust. Ruff can be used to replace Black, Flake8 (plus dozens of plugins), isort, pydocstyle, pyupgrade, and more, all while executing tens or hundreds of times faster than any individual tool.
Ruff v0.16 has a small number of breaking changes, allowing most users to update without significant changes to code or configuration.
Ruff now enables 413 rules by default, up from 59 in previous versions. Since Ruff's default rule set was last modified in v0.1.0, the number of rules in Ruff has grown from 708 to 968. Many of these rules catch severe issues, including syntax errors and immediate runtime errors but were not previously enabled by default.
If you want to revert to the old default set, you can easily select the old rules with this configuration:
[lint]
select = ["E4", "E7", "E9", "F"]
Ruff v0.16 also includes several newly stabilized features. Ruff can now format Python code blocks embedded in Markdown files (.md, Quarto .qmd). It supports fenced code blocks with python, py, python3, py3, pyi, or pycon info strings.
New suppression comments have been introduced: # ruff: ignore[RULE] for line/logical line suppression and # ruff: file-ignore[RULE] for file-level suppression, both supporting optional reason strings and automatic insertion via --add-ignore CLI flag.
Diagnostic output for check and format --check now renders diffs directly under the help diagnostic. A minor breaking change in JSON output allows filename and location fields to be null instead of defaulting to empty string and row 1, column 1.
Multiple rules have been stabilized, including AIR303, CPY001, FURB164, FURB192, ISC004, LOG004, PLE0304, PLR0917, PLR1708, RUF036, RUF063, and RUF068.
Source: Hacker News
















