Ruff 0.17.4
Ruff 0.17.4 shipped on November 5, 2026, and it behaves exactly like a patch release: a couple of crash fixes, an autofix that stopped rewriting code it should not have touched, and nine performance patches you will never notice individually. Skepticism is warranted before you turn on the preview rules, but the stability work is real.
- G004 autofix no longer changes behavior — The
flake8-logging-formatfix could alter runtime behavior and produce syntax errors; both are addressed, so the fix is safe to apply again (#27419). - New preview rule tarfile-ignore-zeros-true — A
securityrule that flagstarfile.open()calls relying on the default zero-block handling, which can silently truncate archives (#28680). - BOM-prefixed files no longer panic — The diagnostic renderer used to crash on files starting with a byte-order mark; it now renders diagnostics normally (#30017).
- Bare raise before a semicolon parses — A regression that rejected
raisefollowed by;is fixed, along withmatchidentifiers appearing after a semicolon (#29761, #29760). - SIM102 reaches more cases — Collapsible
elifclauses following anifbranch with multiple statements are now reported byflake8-simplify(#29814). - Readable fix diffs — More nonprinting characters are shown in diagnostic diffs instead of being rendered invisibly, which makes whitespace bugs far easier to spot (#30062).
- Formatter throughput — Source slices are coalesced when formatting attributes, formatter source-slice overhead is reduced, node fields are written directly when comment handling is unnecessary, and a Bloom filter now handles formatter comment lookups (#29841, #29855, #29853, #29852).
- Linter throughput — Return statements are collected with a statement-only visitor, callee qualified names are reused across rules,
pyflakesdefers value comparisons for repeated dictionary keys (F601,F602), and ordinary writes use a concrete buffer (#29911, #29916, #29739, #29819). - Color handling follows the spec —
NO_COLORnow takes precedence andCLICOLOR=0is honored in both Ruff and ty diagnostics (#29898, #29910). - Stricter __debug__ checks — The syntax-error check for writes to
__debug__now covers attribute targets as well (#27908).
Upgrade with uv tool upgrade ruff or pip install -U ruff==0.17.4, then run ruff check --preview on a branch before committing to the new rules.