- How you use it
- You ask for it
- What it can do
- writes files · runs shell
- What's inside
The option
| Option | ASkill · v1.0.0Ruff 0.17 breaking-change scan (read-only) |
|---|---|
| How you use it | You ask for it |
| What it can do | writes files · runs shell |
| What's inside |
What this thread does
As of November 2026, update Ruff to 0.17.6 (checked 2026-11-24), then review UP032 changes on a branch before restoring automated fixes.
Not for: G004 on an f-string inside a logging call after a UP032 rewrite; that logging diagnostic is distinct from the conversion-correctness cases addressed here.
What changed
- The official release notes date this patch to 2026-10-26 (checked 2026-10-28) and identify a fix for incorrect UP032 conversions.
- The same notes add preview
shared-clock-mock, stdout buffering forruff format, and lexer performance work; they give no application-specific speedup guarantee.
- Version baseline: the release list identifies 0.16.10 as the preceding minor's last release. Versioning policy permits breaking changes in minor releases; the 0.17.0–0.17.3 range therefore matters (checked 2026-10-28).
- 0.17.0 migration changes (checked 2026-10-28):
- Unconfigured Python target: 3.11, previously 3.10; syntax checking assumes 3.15, previously 3.14.
- Defaults drop DTZ001/005/006/007/011/012/901 and enable F406.
- JUnit suites use
skipped, replacingdisabled; the root also gainsskipped. - ICN001 recognizes
datetime as dt; default dummy-variable matching accepts underscore-prefixed Unicode names. - Identifier normalization and named escapes use Unicode 17.
- Full CLI output shows unsafe/manual fixes; application still requires opt-in for unsafe fixes.
- Conda-forge drops its Python dependency:
python -m ruffandimport ruffstop working; invokeruff. ruff-lspsupport ends; VS Code uses the native server and ignoresruff.nativeServer.- TID254, TID255 and RUF071 leave preview.
- Formatter/I001/E501/W505 ignore trailing pragma comments for line length, potentially changing import formatting.
- 0.17.1 expands mutable-container recognition for
collections/weakref; 0.17.2 demotes comment-deleting PLR5501/PLW0120/UP035 fixes to unsafe (checked 2026-10-28).
How to migrate
1. Update the existing ruff dependency and lockfile to the target above, including the copy used by editor hooks and CI. The installation docs identify the package as ruff; use your project's existing dependency manager. 2. Run ruff check --select UP032 on the affected files first. The linter guide documents ruff check, --select and --fix; selecting one rule isolates this review. 3. On a branch, rerun with --fix, inspect the diff, and run the formatting-sensitive application tests before accepting it. Do not add --unsafe-fixes just to make an unchanged call disappear. 4. Review already-merged f-string repairs separately; updating a linter does not restore the original source.
The problem
An agent can produce valid-looking f-strings whose output or evaluation behavior differs from the original str.format call.
What breaks
PR #25485 by anishgirianish says the repair now skips non-identifier attributes, problematic quoted or backslash keys, unknown conversions, and mixed numbering. A retained format call can therefore be expected behavior, rather than a reason to force a rewrite. The rule reference says fixes are only sometimes available.
Diagnostic: Ruff UP032 changes output after an auto-fix
Compare the original expression and repaired expression with identical inputs, including side effects. This is a behavior symptom, not one universal exception message.
What to test
Use small fixtures covering attribute names, mapping keys with quotes or backslashes, and mixed field numbering. Compare return values, exceptions and evaluation side effects before and after each accepted repair. These are proposed regression checks, not reported results for your project.
Pitfalls
Do not equate a clean lint run with equivalent runtime behavior. Do not broaden the enabled rules or preview settings in the same change; that makes a correctness review harder.
Evidence
- dscorbett's issue #15874 demonstrates several ways conversion can change behavior, including argument evaluation and formatting side effects.
- anishgirianish's merged PR #25485, approved by ntBre, explicitly fixes only part of that report. It is implementation evidence, not proof that every example in the wider issue is resolved.
Reports from users
- @rpdelaney, 2024-10-24: "this code now throws G004." Report #13916 shows a logging call where Ruff 0.6.9's UP032 recommendation conflicts with G004; deferred
%slogging is the reporter's alternative. This is a historical rewrite pitfall, not proof of a 0.17.3 regression (checked 2026-10-28).
A prompt to give your agent
Your training data predates this release. Read <https://github.com/astral-sh/ruff/releases/tag/0.17.3> and <https://github.com/astral-sh/ruff/pull/25485> before editing; do not guess the changed cases. Use Ruff 0.17.6 (as of November 2026; checked 2026-11-24), isolate UP032, and show a small diff plus before/after behavior tests. Preserve calls without an equivalent f-string and identify anything untested.
Limits
No package installation, auto-fix run or application regression test is reported here. Evidence comes from an issue and its partial fix; independent post-upgrade confirmation is thin. The patch does not promise to repair past source edits or eliminate every UP032 correctness issue. The versioning policy gives no maintained-version/EOL table; 0.16.10 is a release-history baseline, not a verified support guarantee. Coverage highlights selected migration and UP032 changes from 0.17.0–0.17.3; it does not cover every release note; the supported starting version remains unresolved.
Started from a post by @astral-sh, packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.