Skip to content

ruff-audit: zero-tolerance py3.11 syntax floor over the whole repo (#7667) - #7694

Merged
squid-shepherd[bot] merged 2 commits into
mainfrom
ci/py311-syntax-floor
Nov 4, 2026
Merged

squid-shepherd[bot] merged 2 commits into
mainfrom
ci/py311-syntax-floor

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

What

tests/ruff_audit.py --ci gains a zero-tolerance syntax pass, run_syntax_check(). It runs ruff check . --select E9 over the whole repo at pyproject's target-version = "py311", and fails on anything a 3.11 interpreter cannot parse. pyproject's tests/fixtures/* exclude still applies.

Why

Main went red on #7667: every py3.11 leg of the Full Suite Gate failed, on Windows, Ubuntu and macOS. The cause was #7637, which put a backslash inside an f-string expression in tests/cics_crucible/test_container_ccsid_4270.py:145. That's legal on 3.12 and a SyntaxError on 3.11. #7637 passed every PR check for two reasons:

  • PR CI runs Python 3.12 only.
  • The baseline-gated lint (SCAN_ROOT) scans gitgalaxy/ only, so ruff never parsed tests/.

Ruff already knows the 3.11 floor. Run on #7637's version of the file, the new check reports the lines that broke main:

ccsid_7637.py:145:47: invalid-syntax: Cannot use an escape sequence (backslash) in f-strings on Python 3.11 (syntax was added in Python 3.12)
ccsid_7637.py:146:55: invalid-syntax: Cannot use an escape sequence (backslash) in f-strings on Python 3.11 (syntax was added in Python 3.12)

This is item 2 of the red-main review of Oct 31 to Nov 4. Of the 25 ci-red-main issues in that window, 3 came from legs PR CI never runs; this closes the Python 3.11 one.

Cost

One extra ruff check with a single rule family over about 1,800 files, a second or two, inside the existing ruff-audit job. No new job, no new runner request.

Class / Sibling gaps

Platform gap PR CI never runs Red-main issue Covered by
py3.11 syntax (f-string backslash or reused quote) #7667 this PR
Windows: a bash invocation in a test #7312 (#7171) separate PR (item 4)
Windows: LF-bytes assumption #7619 (#7577) separate PR (item 4)
py3.11 runtime/stdlib differences (not syntax) none in the window not covered: needs a 3.11 test leg

Checks

  • New tests/tools/test_ruff_syntax_gate.py, 3 tests: flags a 3.11-invalid f-string under tests/, passes clean code and the excluded fixtures, and the live repo parses under 3.11.
  • ruff_audit.py --ci: OK, 72-finding baseline, format clean.
  • test_change_classifier.py, test_content_keyed_baseline.py, test_audit_skip_plan.py: 91 passed.

🤖 Generated with Claude Code

…ot just gitgalaxy/ (#7667)

PR CI runs 3.12 only and the baseline-gated lint scans gitgalaxy/ only, so #7637's
backslash-in-f-string in tests/cics_crucible/ passed every PR check and broke main's
py3.11 legs. ruff_audit --ci now also runs `ruff check . --select E9` at pyproject's
py311 target; on #7637's file it reports line 145, the line that broke main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…has no ruff)

test_ci_check_end_to_end and test_ruff_audit_fails_on_format_alone stub the lint and format
calls; the new syntax pass ran real ruff and failed with FileNotFoundError on Smoke. Also pin
that a syntax finding alone fails run_ci_check, and scope the needs-ruff skip to the three
tests that run ruff.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 4, 2026
@squid-shepherd

squid-shepherd Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 4, 2026 15:30
@squid-shepherd

squid-shepherd Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit 4a6cfb6 into main Nov 4, 2026
34 checks passed
@squid-shepherd
squid-shepherd Bot deleted the ci/py311-syntax-floor branch November 4, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant