Skip to content

Match 5-character rule codes in ecosystem check#25677

Merged
ntBre merged 1 commit into
mainfrom
brent/async-ecosystem-check
Jun 8, 2026
Merged

Match 5-character rule codes in ecosystem check#25677
ntBre merged 1 commit into
mainfrom
brent/async-ecosystem-check

Conversation

@ntBre

@ntBre ntBre commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

I noticed while extending the regex to match human-readable names that it also didn't cover the
ASYNC rules, which have five letters in the rule code. For example, #24644 revealed no new
diagnostics in the ecosystem, but a local run on my cached ecosystem repos revealed many
diagnostics. This won't show up as a diff in CI on this PR but should help with ecosystem checks on
the ASYNC rules in the future.

Summary
--

I noticed while extending the regex to match human-readable names that it also didn't cover the
ASYNC rules, which have five letters in the rule code. For example, #24644 revealed no new
diagnostics in the ecosystem, but a local run on my cached ecosystem repos revealed many
diagnostics. This won't show up as a diff in CI on this PR but should help with ecosystem checks on
the ASYNC rules in the future.
@ntBre ntBre added the testing Related to testing Ruff itself label Jun 5, 2026
@astral-sh-bot

astral-sh-bot Bot commented Jun 5, 2026

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@MichaReiser MichaReiser self-requested a review June 8, 2026 07:12

@MichaReiser MichaReiser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

# the old and new rendering with severities.
CHECK_DIAGNOSTIC_LINE_RE = re.compile(
r"^(?P<diff>[+-])? ?(?P<location>.*): (?:(?P<severity>[a-z]+)\[)?(?P<code>[A-Z]{1,4}[0-9]{3,4}|[a-z\-]+:)\]?(?P<fixable> \[\*\])? (?P<message>.*)"
r"^(?P<diff>[+-])? ?(?P<location>.*): (?:(?P<severity>[a-z]+)\[)?(?P<code>[A-Z]{1,5}[0-9]{3,4}|[a-z\-]+:)\]?(?P<fixable> \[\*\])? (?P<message>.*)"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not something we have to do now but can we come up with a regex that will also work with human readable names and doesn't require length constraints (which seems very error prone)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's what I was working on when I found this. On Amy's PR I tried normalizing them so that we avoided seeing any changes in the ecosystem report. I'm not sure if we want to go that far, but it also has a working regex.

@ntBre ntBre merged commit b31a5d3 into main Jun 8, 2026
45 checks passed
@ntBre ntBre deleted the brent/async-ecosystem-check branch June 8, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Related to testing Ruff itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants