Repository navigation
chore(deps): move the vendored Ruff to 0.17.3 - #584
Merged
Merged
Conversation
Move third_party/rust/ruff from Ruff 0.16.6 (22f65a2ab) to the latest release, 0.17.3 (ba65abf8b). - Mirror the workspace dependencies the Ruff crates now inherit from the root Cargo.toml: url, web-time, icu_normalizer, hashbrown, phf and phf_codegen, Ruff's own ruff_unicode_names2 crates (they replace the crates.io unicode_names2), and newer char_str, get-size2, quick-junit and salsa. - Turn on ruff_python_parser's "stacker" feature. Ruff 0.17.1 made the parser's stack growth opt-in, and every Ruff binary enables it, so deeply nested expressions keep the protection they had before. - Raise the Rust minimum from 1.96 to 1.97, which Ruff 0.17 needs, in the workspace, the validators, the CI toolchain pins and the docs. - Adapt python_safe_eval to the renamed AST and token APIs (comparison operands, mutable f-string parts, compact call arguments, and TokenKind::Identifier). - Update the formatter's provider identity to [email protected]+ba65abf8ba. Citry's formatter output is unchanged on the golden corpus and on extra probes. Ruff's syntax errors now say "identifier" where they said "name". Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ruff 0.16.7 (astral-sh/ruff#28259) writes a string inside a nested f-string format field with the other quote character, so f"{v:{d["n"]}}" becomes f"{v:{d['n']}}". Add a golden case for it, record it in the citry-core changelog, and clarify three comments from the review. Co-Authored-By: Claude Opus 5.5 <[email protected]>
JuroOravec
force-pushed
the
chore/ruff-0.17.3
branch
from
November 2, 2026 13:46
9e1775f to
61f04a9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the vendored Ruff in
third_party/rust/rufffrom 0.16.6 (22f65a2ab, 2026-09-03) to 0.17.3 (ba65abf8b, 2026-10-26). 0.17.3 is Ruff's newest release;scripts/ruff_submodule_updates.py checknow reports "In sync".What changed for Citry
Cargo.toml, so the new ones Ruff 0.17 uses are added there:url,web-time,icu_normalizer,hashbrown,phf/phf_codegen, and Ruff's ownruff_unicode_names2crates. Ruff's crates replace the crates.iounicode_names2, and their Unicode data files ship in the citry-core sdist (checked withmaturin sdist).char_str,get-size2,quick-junitandsalsamove to the versions Ruff now needs.stackerfeature (astral-sh/ruff#29505). Every Ruff binary turns it on, so Citry does too, in the rootruff_python_parserentry. Deeply nested template expressions keep the protection they had before.rust-version, the toolchain and distribution validators and their tests, every CIRUSTUP_TOOLCHAINpin,pyodide-build.json, and the docs move to 1.97. I checked locally thatcitry_core_pybuilds with Rust 1.97.0. The archived 0.6.0 docs and older changelog entries keep 1.96.python_safe_evalcode changes for renamed Ruff APIs. A comparison stores all of its operands in oneoperandslist, and the sandbox walks every item in it, which covers the left side as well. Iterating an f-string mutably now givesFStringPartMut. Call arguments are now aThinVec.TokenKind::Nameis nowTokenKind::Identifier.[email protected]+ba65abf8ba(the constant, the golden-corpus index, the Python, LSP andcitry formattests, and the design docs).zipstays at 8.6.0 because Ruff 0.17.3 still pinszip8, so thedeny.tomlentries stay until a Ruff release moves tozip9 (Remove the zip 8 advisory exceptions once vendored ruff moves to zip 9 #378). A newer zip advisory, RUSTSEC-2026-0429, failsrust-auditon main as well as here. build(deps): apply the open Dependabot updates for setup-uv, ty, and the JS tools #582 adds it todeny.toml, so this check passes once build(deps): apply the open Dependabot updates for setup-uv, ty, and the JS tools #582 merges.Formatting differences users will see
One. Ruff 0.16.7 (astral-sh/ruff#28259) writes a string inside a nested f-string format field with the other quote character:
The golden corpus had no such case, so this PR adds
expressions/nested-format-quotes. Its expected file holds the output observed from this build, and the corpus test fails if the expected file holds the old output. The citry-core changelog records the change.Nothing else changed. The rest of the corpus passes unchanged, and 24 extra templates formatted the same with the 0.16.6 and 0.17.3 builds. They cover trailing pragma comments that push a line past the width (Ruff 0.17.0 leaves those comments out of line length), comparison chains, f-strings, lambdas and long calls. Citry still pins Python 3.10 for formatting. Ruff's new default Python version only affects Ruff's list of syntax a given Python version does not support, which Citry does not read.
One message changes: a Python syntax error in a template expression says
found identifierwhere it saidfound name. The citry-core changelog records this and the Rust 1.97 requirement.Security
python_safe_evalis the expression sandbox, so an independent reviewer checked it against both builds. The probes covered comparison chains with__import__, attributes, calls, lambdas or walrus in every position; f-strings with implicit concatenation, nested format fields and debug text; t-strings; and full-width look-alike names (eval). Every operand was still intercepted, and the generated code matched 0.16.6. Depth limits gave the same accept/reject results near the limit.Checks run
cargo test -p python_safe_eval -p citry_template_parser -p citry_template_formatter: 1041 passed; after the corpus case was added, the formatter and safe_eval tests passed again (421).cargo clippy --no-deps ... --all-targets -D warningsandcargo fmt --checkfor those crates pluscitry_core_py: clean.cargo check -p citry_core_py -p citry_template_formatterwith Rust 1.97.0: passes.citry format, LSP project and toolchain validator tests: 612 passed.scripts/validate.py: all pass.🤖 Generated with Claude Code