2025-06-12 · Astral

Ruff v0.12.0

tooling

read at source ↗ astral.sh

Ruff v0.12.0

Source: Astral Date: 2025-06-12 URL: https://astral.sh/blog/ruff-v0.12.0

Summary

Ruff v0.12.0 makes the parser version-aware: it now detects version-related syntax errors (match statements on pre-3.10 targets) and compiler-level errors (duplicate parameters, unreachable yield/return). A new per-file-target-version setting supports multi-version projects. Defaults: Python 3.13 for syntax detection, 3.9 for other analyses. 24 rules promoted from preview; PD901 deprecated; S320 removed.

Implications

Version-aware parsing is the missing piece for multi-version Python support. Projects maintaining compatibility across Python 3.9-3.13 could previously only get version-specific lint via tox matrix runs or separate CI jobs. per-file-target-version means a single Ruff invocation can check src/ against 3.9 and scripts/ against 3.13. This removes a real CI complexity that was keeping mypy/Pyright in the picture for version-aware checks. The Python 3.13.4 grammar change forcing the f-string fix is a reminder that Ruff’s correctness now tracks CPython patch releases, not just minors — a higher bar than most teams expect from a linter.

← all signals