Change8

Migrating to Ruff 0.12.0

Version 0.12.0 introduces 4 breaking changes. This guide details how to update your code.

Released: 6/17/2025

4
Breaking Changes
5
Migration Steps
12
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

RUF005FURB129SIM108RUF100S603FBT001UP007UP045S320RUF061syntax-errorsrust-toolchain.toml

Breaking Changes

Issue #1

Ruff now detects version‑related syntax errors (e.g., use of `match` on Python <3.10 and irrefutable `match` patterns before the final `case` arm), which can cause new lint errors in code that previously passed.

Issue #2

The default Python version for syntax‑error detection is now the latest supported version (3.13) instead of the minimum supported version (3.9); projects without an explicit Python version may see different diagnostics.

Issue #3

Multi‑line f‑strings with format specifiers are now formatted without inserting a line break after the specifier to comply with Python 3.13.4 grammar changes.

Issue #4

`rust-toolchain.toml` is no longer included in source distributions, which may affect downstream builds that relied on it.

Migration Steps

  1. 1
    Read the migration guide in the blog post https://astral.sh/blog/ruff-v0.12.0.
  2. 2
    If your project does not specify a Python version, add a `--target-version` or `pyproject.toml` setting to lock the version you want, as Ruff now defaults to Python 3.13 for syntax‑error detection.
  3. 3
    Review any custom `include`, `ignore`, or `noqa` settings for rule `UP045` (formerly part of `UP007`) and adjust them if necessary.
  4. 4
    If you relied on `rust-toolchain.toml` being present in the source distribution, remove it from your package or provide your own Rust toolchain configuration.
  5. 5
    Update any CI or build scripts that expected the `rust-toolchain.toml` file to be installed automatically.

Release Summary

Ruff 0.12.0 introduces stricter syntax‑error detection, updates f‑string handling, drops the `rust-toolchain.toml` from distributions, deprecates the pandas‑df‑variable‑name rule, adds preview checks for pytest helpers, and includes numerous bug fixes.

Need More Details?

View the full release notes and all changes for Ruff 0.12.0.

View Full Changelog