Repository navigation
docs(review-rules): list every built-in rule mapping in all five locales - #1785
Merged
lizhengfeng101 merged 2 commits intoNov 10, 2026
Merged
Conversation
Eight patterns of the embedded system_rules.json path_rule_map had no row in the review-rules guide's pattern table: pug, nix, Haskell, Nim, Swift, Zig and the two OCaml/ReasonML patterns. The table is the published form of the mapping and the page claims to show it in matching order, so a reader could not tell that those languages resolve to a dedicated rule document instead of default.md. Add the missing rows to en, zh, ja, ko and ru, and drop the "Selected" wording above the table, which is now exhaustive. TestReviewRulesGuideListsEverySystemRulePattern keeps the table and the embedded map in step: every mapped glob must be listed, the rule document named on the row must be the one the map points at, and a row for a glob absent from the map is an error as well.
Contributor
|
✅ OpenCodeReview: Review skipped: no items were selected. |
10 of 15 tasks
This was referenced Nov 10, 2026
6 tasks done
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 review-rules guide publishes the embedded
system_rules.jsonpath_rule_mapas a pattern → rule-document table (Rule resolution per file), and says it is shown in relative matching order. That table is hand-maintained in five locales and had fallen behind: 8 of the 57 patterns are missing from every locale (en, zh, ja, ko, ru), so the guide never tells a reader that these languages resolve to a dedicated rule document instead ofdefault.md:**/*.pugpug.md**/*.nixnix.md**/*.{hs,lhs}haskell.md**/*.{nim,nims,nimble}nim.md**/*.swiftswift.md**/*.zigzig.md**/*.{ml,mli}ocaml.md**/*.{re,rei}ocaml.mdEvery one of those 8 extensions is already in
internal/config/allowlist/supported_file_types.json, mapped ininternal/config/rules/system_rules.json, and backed by an embedded rule document — the existing integrity tests ininternal/config/rules/system_rules_test.gocheck that direction (referenced doc exists, no orphan doc, mapped extension is allowlisted). Only the guide was out of step with the mapping it documents.This PR adds the missing rows in all five locales (in the same relative order the rows already follow) and drops the
Selectedwording from the sentence above the table, which is now exhaustive.TestReviewRulesGuideListsEverySystemRulePatternis the guard that stops this recurring. It reads the embeddedsystem_rules.jsonand the fivepages/src/content/docs/<locale>/review-rules.mdpages, and reports three kinds of drift per locale:Relative row order is deliberately not asserted: the patterns are disjoint, so a reordered row cannot change which rule a file resolves to.
Enumerating the gap
A script comparing the two sources before the change:
Not changed here
Two rows sit in a different relative order than
system_rules.jsonin all five locales:**/*.{glsl,hlsl,wgsl,metal}is listed before**/*.{v,sv,vh}, and**/*.Rbefore**/*.{cpp,cc,cxx,hpp,hxx}. The patterns are disjoint and matching is first-match-wins, so resolution is unaffected; I left the page's grouping alone rather than reorder rows in a documentation-only change. Say the word and I will line them up and assert order in the same guard.Type of Change
No Go production code changes: the
system_rules.jsonmapping, the resolver and the file filter are untouched. The added file is a test.How Has This Been Tested?
make testpasses locallyThe new guard fails on the pre-change docs, one failure per missing glob per locale (40 in total):
and passes after the change:
Each assertion was checked by breaking the page and watching it fire, one direction at a time, then restoring:
After restoring the page, the guard is green again.
Gates on the final commit:
The translation-sync guardrail was run as well (
node scripts/github-actions/check-translation-sync.test.js, andcheck-translation-sync.js readmes), both green; all five locales are edited symmetrically in this PR.Checklist
go fmt,go vet)AI/LLM disclosure: the change and the guard test were drafted by an AI coding assistant (Hermes Agent, model deepseek-v4-flash). The account owner read the entire diff line by line, independently re-ran the enumeration, the three broken-page checks and the gates quoted above, and is responsible for the content. Commits are not attributed to the tool.
CLA: the
license/clacheck reports it as signed for this account.Related Issues
No issue: the gap was found by comparing the guide against the embedded mapping rather than from a report. I will file a documentation issue if you would rather have this tracked that way before merge.
Relative to the open #1541 (
docs(review): correct the default exclude list and test it against the json), which does the same thing for thedefault_exclude_patterns.jsonlist on the same page: this PR touches only the pattern → rule table, so the two do not overlap.