RC RANDOM CHAOS

Ruff 0.16 turns on 413 lint rules by default, up from 59

· via Hacker News

Original source

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

Hacker News →

Ruff, the Rust-based Python linter and formatter, ships v0.16 with a dramatically expanded default rule set: 413 rules enabled out of the box, up from just 59. The team hadn’t touched the defaults since v0.1.0, during which Ruff’s total rule count grew from 708 to 968. Many of the newly-enabled rules flag genuinely severe problems—syntax errors and immediate runtime failures—that previously stayed silent unless users opted in. Highlights include checks pulled from flake8-bugbear, pyupgrade, and Ruff’s own RUF category. Anyone who preferred the old behavior can restore it by selecting just the E4, E7, E9, and F rules, but this is the release’s main breaking change and the framing suggests it’s tied to a broader rule-recategorization effort still to come.

Beyond the defaults, v0.16 stabilizes several features. Ruff can now format Python code blocks embedded in Markdown (and Quarto notebooks), recognizing py, pyi, and pycon fences, with fmt: off/on and HTML-comment suppression. A new native suppression syntax—ruff: ignore for a line or logical line, ruff: file-ignore for a whole file, each optionally carrying a reason—complements the ruff: disable/enable ranges added in v0.15, and a —add-ignore flag can insert these comments automatically. Fix diffs now appear inline in check and format —check output rather than only behind —diff, and format —check gains the linter’s full range of output formats, including JSON and CI-annotation formats for GitHub and GitLab.

The release also carries a dozen rule stabilizations and assorted behavioral tweaks that reduce false positives, plus a minor breaking change: several JSON output fields (filename, location, fix edit locations) can now be null instead of defaulting to empty strings or row/column 1. For most teams the upgrade is low-friction, but the vastly larger default rule set means existing projects should expect a wave of new diagnostics on first run.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.