Skip to content

Normalize rule selectors in ecosystem checks - #27158

Merged
ntBre merged 2 commits into
mainfrom
brent/fix-ecosystem-check
Jul 24, 2026
Merged

ntBre merged 2 commits into
mainfrom
brent/fix-ecosystem-check

Conversation

@ntBre

@ntBre ntBre commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Now that we allow rule names in selectors in preview, we need to normalize them back to codes to
allow running on stable. This PR implements this normalization as one of our config overrides,
using the comparison executable to extract the rule mapping from ruff rule.

Test Plan

CI on this PR and then #27154

Summary
--

Now that we allow rule names in selectors in preview, we need to normalize them back to codes to
allow running on stable. This PR implements this normalization as one of our other config overrides,
using the comparison executable to extract the rule mapping from `ruff rule`.

Test Plan
--

CI on this PR and then #27154
@ntBre ntBre added the ci Related to internal CI tooling label Jul 24, 2026
@astral-sh-bot

astral-sh-bot Bot commented Jul 24, 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.

@ntBre
ntBre marked this pull request as ready for review July 24, 2026 13:46
@ntBre
ntBre requested review from Gankra and MichaReiser July 24, 2026 13:46
Comment on lines +512 to +516
rule_names = (
rule_name_to_code(ruff_comparison_executable.resolve())
if not options.preview
else {}
)

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.

Can we add a TODO here that this should be removed once we stabilize human readable names. It makes it clear that this is a temporary hack and LLMs might be good enough at finding this and also removing it in the stabilization PR.

It might also be worth adding a comment to the human readable name preview function to mention that this change should be reverted when stabilizing the feature.

Comment on lines +177 to +181
rule_names = (
rule_name_to_code(ruff_comparison_executable.resolve())
if not options.preview
else {}
)

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.

Same here and in other places. Add a comment that this is a temporary work around

@ntBre
ntBre enabled auto-merge (squash) July 24, 2026 14:39
@ntBre
ntBre merged commit 77be1b6 into main Jul 24, 2026
46 checks passed
@ntBre
ntBre deleted the brent/fix-ecosystem-check branch July 24, 2026 14:45
Andrej730 pushed a commit to Andrej730/ruff that referenced this pull request Jul 24, 2026
Summary
--

Now that we allow rule names in selectors in preview, we need to
normalize them back to codes to
allow running on stable. This PR implements this normalization as one of
our config overrides,
using the comparison executable to extract the rule mapping from `ruff
rule`.

Test Plan
--

CI on this PR and then astral-sh#27154
Andrej730 pushed a commit to Andrej730/ruff that referenced this pull request Jul 25, 2026
Summary
--

Now that we allow rule names in selectors in preview, we need to
normalize them back to codes to
allow running on stable. This PR implements this normalization as one of
our config overrides,
using the comparison executable to extract the rule mapping from `ruff
rule`.

Test Plan
--

CI on this PR and then astral-sh#27154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Related to internal CI tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants