Open Source

Ruff v0.16.0: Default Rule Set Expansion and Markdown Support

Astral releases Ruff v0.16.0, significantly expanding the default rule set from 59 to 413 rules and introducing Python code block formatting for Markdown.

A
AIDeveloper44 Team
July 28, 2026·5 min read
Ruff v0.16.0: Default Rule Set Expansion and Markdown Support

Ruff v0.16.0 brings significant updates to the Python linting and formatting ecosystem.

TL;DR
  • The default rule set has expanded from 59 to 413 enabled rules to catch more severe runtime and syntax issues.
  • Ruff now supports formatting Python code blocks embedded within Markdown and Quarto files.
  • New suppression comments like ruff: ignore and ruff: file-ignore allow for granular diagnostic control with optional reasons.
  • Linter and formatter diffs are now displayed by default in the standard output of check and format --check commands.

Overview of Ruff v0.16.0

Astral has released Ruff v0.16.0, a significant update to the Rust-based Python linter and formatter. This version introduces substantial changes to the default user experience, most notably a major expansion of the rules enabled by default. Since its initial release, Ruff has positioned itself as a high-performance alternative to traditional Python tooling such as Flake8, Black, and isort. The v0.16.0 release continues this trajectory by stabilizing several preview features and refining how the tool handles documentation and configuration suppression.

Expanded Default Rule Set

The most impactful change in v0.16.0 is the modification of the default rule set. Previously, Ruff enabled 59 rules by default. With this update, that number has increased to 413. This change is intended to surface severe issues, including syntax errors and immediate runtime errors, which were previously implemented in Ruff but required manual activation via configuration files. Since version 0.1.0, the total number of rules available in Ruff has grown from 708 to 968. The updated default set now draws from a wider variety of sources, including highlights from flake8-bugbear (B), pyupgrade (UP), and Ruff’s internal RUF category.

While the update primarily expands the default coverage, Astral has also removed 18 rules from the default set. These rules, primarily from the pycodestyle (E) and pyflakes (F) categories, were deemed too opinionated for a general default configuration. The specific rules removed include E401, E402, E701, E702, E703, E711, E712, E713, E714, E721, E731, E741, E742, E743, F403, F405, F406, and F722. Users who prefer the previous behavior can revert to the old defaults by explicitly selecting the E4, E7, E9, and F categories in their configuration files.

Markdown and Quarto Integration

Ruff v0.16.0 extends its formatting capabilities to Markdown files. The tool can now detect and format Python code blocks embedded within Markdown documentation. This feature applies to fenced code blocks identified with info strings such as python, py, python3, py3, pyi, or pycon. Each type is handled according to its specific context; for instance, pyi blocks are treated as stub files, while pycon blocks are formatted as REPL sessions.

This functionality also applies to Quarto notebooks, as Ruff recognizes language identifiers enclosed in curly braces, such as {python}. To manage formatting within these files, users can employ standard fmt: off and fmt: on comments. Additionally, HTML comments can be used to disable formatting for specific regions of a Markdown document. Users who wish to exclude Markdown files entirely can use the extend-exclude setting with a *.md glob pattern.

Advanced Suppression Mechanisms

The release introduces new suppression comment formats to provide more control over linter diagnostics. Building on the range suppression (disable/enable) introduced in v0.15, v0.16.0 adds ruff: ignore and ruff: file-ignore. The ruff: ignore comment can suppress a diagnostic on the same line or the following logical line. This is particularly useful for suppressing errors across a multi-line function header with a single comment.

The ruff: file-ignore comment functions similarly to ruff: noqa, suppressing specified diagnostics for an entire file. A notable addition is the support for associated reasons within these comments, allowing developers to document why a specific rule is being ignored. Furthermore, a new CLI flag, --add-ignore, enables the automatic addition of these comments. In preview mode, these suppression comments now support the use of rule names instead of numeric codes, improving readability.

CLI and Output Refinements

Ruff has improved how it displays information during the linting and formatting process. In v0.16.0, the check and format --check commands now show diffs for available fixes as part of the default output. This integrates the information previously only available via the --diff flag directly into the standard diagnostic view.

The format --check command has also been updated to support the full range of output formats used by the linter, such as machine-readable JSON or formats compatible with GitHub and GitLab CI annotations. However, this version introduces a minor breaking change to the JSON output format. Several fields, including filename, location, and end_location, may now return null rather than empty strings or default coordinates. This change is designed to better reflect the internal representation of diagnostics within the Ruff engine.

Rule Stabilization

Several rules previously available only in preview have been stabilized in this release. Notable stabilized rules include airflow3-incompatible-function-signature (AIR303), missing-copyright-notice (CPY001), too-many-positional-arguments (PLR0917), and duplicate-entry-in-dunder-all (RUF068). Additionally, behavior related to the blind-except (BLE001) rule has been stabilized to suppress diagnostics when an exception is explicitly logged. These rules are now part of the stable toolchain and are subject to standard versioning guarantees.

Diagram: Evolution of Ruff v0.16.0 highlighting massive default rule expansion and new Markdown formatting integration.
References & Sources
  1. Ruff v0.16.0 Release Announcement

Enjoyed this?

Get more posts like this delivered to your inbox.

🚀 Join the AI dev community — follow us everywhere

© 2026 MARKTECHPOST AI MEDIA INC. All rights reserved.Terms & ConditionsPrivacy Policy
Beta Mode