Tech

Astral expands Ruff default rules to 413 in major v0.16.0 release

The latest update from Astral introduces expanded default rule sets, Markdown formatting capabilities, and new suppression mechanisms for developers.

Author
Owen Mercer
Markets and Finance Editor
Published
Draft
Source: Hacker News · original
Tech
No image available
Python linter and formatter sees significant shift in configuration strategy

Astral has released Ruff v0.16.0, a substantial update to the open-source Python linter and formatter that significantly alters the tool’s default configuration. The release increases the number of enabled default rules from 59 to 413, incorporating categories from flake8-bugbear, pyupgrade, and RUF. This expansion aims to catch severe issues, including syntax and immediate runtime errors, without requiring manual configuration from users.

The update marks a strategic shift towards a more opinionated default setup. Since version 0.1.0, the total number of rules in Ruff has grown from 708 to 968, with many previously disabled rules now active by default. Users who wish to revert to the previous default rule set can do so through configuration, selecting the older set of rules explicitly.

New formatting capabilities allow Ruff to process Python code blocks embedded within Markdown files, including Quarto notebooks. The tool now recognises specific info strings such as python, py, python3, pyi, and pycon, applying appropriate formatting rules to each. For instance, pyi blocks are formatted as stub files, while pycon blocks are treated as REPL sessions.

The release also introduces a new set of suppression comments to manage diagnostics more granularly. Developers can now use ruff: ignore for single-line suppression or ruff: file-ignore for entire-file suppression, both of which support optional reasons. The --add-ignore CLI flag allows for the automatic addition of these comments, streamlining the process of managing linting violations.

Diagnostic output has been enhanced to display diffs for linter and formatter fixes as part of the default output. The format --check subcommand now supports the full selection of output formats, including JSON and CI annotations for GitHub and GitLab. Additionally, JSON output fields such as filename and location may now return null values, better reflecting the internal diagnostic representation.

Continue reading

More from Tech

Read next: Apple Watch SE 3 Launches as Budget Entry Point in September 2025 Lineup
Read next: Nike and Hyperice launch $249 heated recovery slides
Read next: Public health experts urged to pivot from facts to narratives in vaccine debate