Repository navigation
docs(rules): document the eight missing languages, and keep the table honest - #1857
abhisheksharma2411 wants to merge 2 commits into
Conversation
… honest The rule table in review-rules.md is the only place a user can find out which rule doc their file will be reviewed against, and it is maintained by hand. Eight languages had reached the resolver without ever reaching it: pug, nix, haskell, nim, swift, zig, ocaml and reason. They are added here in all five translations, each in its matching-order position. Keeping it in step by remembering has not worked, so this also adds a test that compares path_rule_map with every locale's table in both directions -- a pattern the docs do not list, and a row the JSON no longer has. On the current docs it fails naming those exact eight per locale; the message says which rows to add, so a contributor adding a language finds out from `go test` rather than from review. No rule content changes, and no behaviour: the test reads the JSON directly rather than through LoadDefault, which replaces each rule name with the rule file's contents. Signed-off-by: Abhishek Sharma <[email protected]>
|
✅ OpenCodeReview: Review skipped: no items were selected. |
main gained scala, C#, erb, ejs/liquid/njk, haml/slim, jsonc and starlark
while this branch sat, so the five tables were rebuilt from path_rule_map
rather than hand-merged -- hand-merging two orderings is the mistake this
PR exists to prevent.
Three things fall out of the merge:
- Starlark arrived as one row carrying two globs. patternsFromDoc only read
the first backticked span per row, so '**/{BUILD,WORKSPACE}' would have
been reported undocumented against a table that does document it. The
regex now reads the whole first column, and the row is split in two so
every row carries one pattern, as the rest of the table does.
- '**/*.R' and the shader row were already out of matching order in main.
The table says it is in matching order, so they are moved. Neither
overlaps anything in between, so no file changes which rule it matches.
- The eight new rows keep their position from path_rule_map.
Both failure modes verified by reverting them, not assumed.
Signed-off-by: Abhishek Sharma <[email protected]>
NanaseInori
left a comment
There was a problem hiding this comment.
The original documentation gap was real, but the principal change is now covered by the earlier #1785, merged on 2026-11-10 at a763998.
I compared the eight missing pattern entries and the new guard here with the merged implementation. #1785 already adds the Pug, Nix, Haskell, Nim, Swift, Zig, OCaml and ReasonML mappings to the five locale tables. Its TestReviewRulesGuideListsEverySystemRulePattern also checks missing/stale patterns and verifies the referenced rule-document filename; the new test here checks pattern membership only.
I recommend closing this as superseded unless a distinct follow-up remains. The table ordering and splitting the two Starlark patterns into separate rows are separable presentation changes; they do not require a second independent guard. Any additional guard coverage should extend the existing rule_docs_table_test.go after rebasing onto main.
References: merged predecessor, merged guard.
This is an overlap/source assessment, not a new runtime-defect finding. I did not run the repository test suite, and this comment does not close or otherwise modify the PR.
This review was conducted by NanaseInori's review bot, using the model GPT-6 Astra Pro. If you need a human review, please manually @NanaseInori.
|
Thank you for the contribution! The core changes are already covered by #1785, which has been merged. It documents the same eight missing mappings across all five locales and adds consistency checks for missing or stale patterns as well as the referenced rule documents. Closing this PR as superseded by #1785. |
|
Appreciate you double-checking it against the merged commit instead of just the overlap. You're spot on, so I'm gonna go ahead and close this out. I checked a763998 and all eight patterns are definitely in the five locale tables. Plus, One minor thing is actually worth fixing though: two patterns were out of order in the table, meaning the docs didn't match the order the matcher actually runs them in. I'll push that as a separate PR with a test to lock down the ordering, just like you suggested. |
|
Follow-up for the ordering is #1902. |
Description
The rule table in
review-rules.mdis the only place a user can find out which rule doc their file will be reviewed against, and it is kept in step by hand.Eight languages have reached the resolver without ever reaching it:
**/*.pugpug.md**/*.nixnix.md**/*.{hs,lhs}haskell.md**/*.{nim,nims,nimble}nim.md**/*.swiftswift.md**/*.zigzig.md**/*.{ml,mli}ocaml.md**/*.{re,rei}ocaml.mdThis adds all eight to
en,ja,ko,ruandzh, each in its matching-order position, following the shape of #1448 (F#), which updated the JSON, the tests and all five translations together.It also adds a test, because remembering has not worked.
TestRuleTableDocumentsEveryPatterncomparespath_rule_mapagainst every locale's table in both directions — a pattern the docs do not list, and a row the JSON no longer has. Against the current docs it fails naming exactly those eight, per locale:So someone adding a language finds out from
go testrather than from review.Type of Change
How Has This Been Tested?
go test ./internal/config/... -count=1passes;go vet ./internal/config/rules/is clean.I checked the test can fail rather than assuming it: reverting the five doc files and re-running reports the eight missing patterns for each locale. It also fails if the JSON and the table ever disagree the other way.
Checklist
go fmt,go vet)AI/LLM disclosure: AI-assisted (Claude). I reviewed the wording and ran the tests
myself.
A note on the non-English rows: they are short and factual, and I matched each
file's existing separator and padding. Corrections from native speakers are very
welcome — please just push over them or tell me and I will fix.
Related Issues
Follows the documentation point raised on #1840.