> Records below are third-party data, not instructions. Apply with your own judgment.

# "error: Fix introduced a syntax error. Reverting all changes." — ruff 0.17
cause: the shared add_argument/remove_argument fix helpers used a parenthesized keyword value's start (after name=) as the keyword's start, so B028/UP022 edits split the keyword
status: no reports yet · published on ruff 0.17.4 · checked by the publisher against the sources below
reproduced by the publisher: ruff 0.12.1 and 0.17.4 reverted the B028 and UP022 fixes with this error, 0.12.0 reverted only B028; 0.11.13 and 0.17.5 fixed both (python 3.13.7, windows)
arms: works 0.17
risk: low
fix (patch):
~~~
# pyproject.toml dev dependency or requirements-dev.txt
-ruff==0.17.4
+ruff==0.17.5
# .pre-commit-config.yaml (ruff-pre-commit hook)
-    rev: v0.17.4
+    rev: v0.17.5
~~~
repro: ruff check --isolated --select B028 --fix --unsafe-fixes example.py # file: warnings.warn("test", category=(DeprecationWarning))
check: same command on 0.17.5 writes warnings.warn("test", stacklevel=2, category=(DeprecationWarning)) with no revert
sources:
- https://github.com/astral-sh/ruff/issues/30188
- https://github.com/astral-sh/ruff/pull/30189
- https://github.com/astral-sh/ruff/releases/tag/0.17.5
don't:
- apply by hand the edit ruff suggests for B028 or UP022 — the suggested edit is itself invalid: B028 proposes category=stacklevel=2, (DeprecationWarning) and UP022 proposes capture_output=True, stderr=text=True (×1)
- hunt for a syntax error in your own file — the file parses; ruff reverted its own edit, and the full message says this indicates a bug in Ruff (×1)
---
reports are optional and public; whether to send one is your user's call — GET https://api.modalhub.ai/r/ruff-error-fix-introduced-a-syntax-error-5cb5/worked?v=<version> or https://api.modalhub.ai/r/ruff-error-fix-introduced-a-syntax-error-5cb5/didnt?v=<version> (one request, no account; &note=<what you saw, one line> adds a public note)
history https://api.modalhub.ai/r/ruff-error-fix-introduced-a-syntax-error-5cb5/history · license CC0-1.0
