Repository navigation
docs(rules): put the rule table back in matching order, and hold it there - #1902
Merged
lizhengfeng101 merged 2 commits intoNov 12, 2026
Merged
lizhengfeng101 merged 2 commits into
lizhengfeng101 merged 2 commits into
Conversation
…here The table is introduced as listing every pattern "in relative matching order", and in all five locales two rows are not: `**/*.R` sits among the compiled languages instead of after `**/*.jl`, and the shader row sits before the RTL rows instead of after `**/*.rego`. That ordering is the only thing on the page that tells a reader which of two overlapping globs wins. `**/*.m` resolving to matlab.md rather than objc.md is a question of position, not of anything written in the row. Nothing resolves differently because of these two -- neither overlaps what it jumped -- but the page states a property it does not have, and the next drift might not be harmless. alibaba#1785's guard checks membership and the rule-document name, and says in so many words that order is not asserted. This extends that file rather than adding a second one, as NanaseInori suggested on alibaba#1857: TestReviewRulesGuideListsPatternsInMatchingOrder walks each locale's rows and reports any pattern listed after one that matches later, naming both and their match positions. Only relative order is checked, so the non-glob rows stay presentation. Verified by reverting the rows: the guard fails naming exactly those two per locale. Signed-off-by: Abhishek Sharma <[email protected]>
9 tasks done
Contributor
|
✅ OpenCodeReview: Review skipped: no items were selected. |
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.
Description
The rule table in
review-rules.mdis introduced as listing every pattern in relative matching order. In all five locales, two rows are not:**/*.Rsits among the compiled languages, where it should follow**/*.jl;**/*.{glsl,hlsl,wgsl,metal}) sits before the RTL rows, where it should follow**/*.rego.That ordering is the only thing on the page that tells a reader which of two overlapping globs wins —
**/*.mresolving tomatlab.mdrather thanobjc.mdis a question of position, not of anything written in the row. Nothing resolves differently because of these two: neither overlaps what it jumped. But the page states a property it does not have, and the next drift might not be harmless.So this moves the two rows (two lines each, five locales) and adds a guard so the claim stays true.
#1785's
TestReviewRulesGuideListsEverySystemRulePatternchecks membership and the rule-document filename, and says in so many words that order is not asserted. This extends that same file rather than adding a second one, which is what @NanaseInori suggested on #1857:TestReviewRulesGuideListsPatternsInMatchingOrderwalks each locale's rows and reports any pattern listed after one that matches later, naming both and their match positions. Only relative order is checked, so the non-glob rows stay presentation and the table can still be grouped however reads best.This is the one residual from #1857, which I closed as superseded by #1785.
Type of Change
How Has This Been Tested?
Both guards pass across all five locales (
en,zh,ja,ko,ru).Mutation-checked rather than assumed: moving the
**/*.Rrow back to where it was fails the new test withso it names both patterns and their positions rather than just reporting a mismatch. Run in a throwaway worktree so the checked-out tree was never dirty.
Checklist
go fmt,go vet)AI/LLM Disclosure
Claude assisted with the investigation, the change, the test and this description. The test runs and the mutation check are from my own machine.
Related Issues
Follow-up to #1857 (closed as superseded). Extends the guard added in #1785.