Repository navigation
Skip invalid string character checks when the source contains none - #29883
Merged
Merged
Conversation
MichaReiser
temporarily deployed
to
automations
November 1, 2026 18:56 — with
GitHub Actions
Inactive
Contributor
|
MichaReiser
marked this pull request as ready for review
November 2, 2026 10:27
MichaReiser
force-pushed
the
micha/skip-absent-invalid-string-characters
branch
from
November 2, 2026 11:30
e261d3b to
702416e
Compare
MichaReiser
temporarily deployed
to
automations
November 2, 2026 11:31 — with
GitHub Actions
Inactive
AlexWaygood
approved these changes
Nov 2, 2026
MichaReiser
temporarily deployed
to
automations
November 2, 2026 13:30 — with
GitHub Actions
Inactive
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
MichaReiser
force-pushed
the
micha/skip-absent-invalid-string-characters
branch
from
November 2, 2026 13:48
8cf6493 to
e665900
Compare
MichaReiser
temporarily deployed
to
automations
November 2, 2026 13:49 — with
GitHub Actions
Inactive
This branch was previously deployed
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.
Summary
Skip the token walk for PLE2510 and PLE2512–PLE2515 when the source contains none of the five characters these rules report. Files containing a candidate character use the existing token checks and interpolation tracking.
On boxed main (
049c351bef), the change reduced instructions in all 15 eligible linter benchmarks. Ten cases used at least 2% fewer instructions, and the pooled reduction was 2.38%. The five default-rule cases used 3.44–13.30% fewer instructions.On the Python 3.12 standard library, end-to-end Ruff lint used 2,942,099,033 → 2,821,572,978 instructions (−4.10%) compared with this PR’s boxed parent (
9623e698ec). Both builds enabled the same 407 rules, including all five affected rules, and produced identical diagnostics across three paired runs.Test Plan
The six invalid-character rule tests passed.