Repository navigation
Normalize rule selectors in ecosystem checks - #27158
Merged
Merged
Conversation
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
marked this pull request as ready for review
July 24, 2026 13:46
MichaReiser
approved these changes
Jul 24, 2026
Comment on lines
+512
to
+516
| rule_names = ( | ||
| rule_name_to_code(ruff_comparison_executable.resolve()) | ||
| if not options.preview | ||
| else {} | ||
| ) |
Member
There was a problem hiding this comment.
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 {} | ||
| ) |
Member
There was a problem hiding this comment.
Same here and in other places. Add a comment that this is a temporary work around
ntBre
enabled auto-merge (squash)
July 24, 2026 14:39
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
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
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