docs(review-rules): document the merge_system_rule field - #1136
Conversation
|
✅ OpenCodeReview: Review skipped: no items were selected. |
|
|
||
| The system half is resolved **per file**, from the same embedded table above — | ||
| one catch-all `**/*` entry yields `java.md` for a `.java` file, `python.md` for | ||
| a `.py` file, and `default.md` for an unrecognized extension. |
There was a problem hiding this comment.
| a `.py` file, and `default.md` for an unrecognized extension. | |
| a `.py` file or a `.ipynb` file, and `default.md` for an unrecognized extension. |
Have you actually referenced system_rules.json before submission?
There was a problem hiding this comment.
After applying this suggestion, you have to sync it.
There was a problem hiding this comment.
Sorry about that, and thanks for catching it. I've confirmed , applied your suggestion, and synced the fix to all five locales.
wu21-web
left a comment
There was a problem hiding this comment.
When AI is not sure about a word, it just skips entirely.
Since I am a native Chinese speaker, here are my suggestions. Please batch and commit if there is no issues.
lizhengfeng101
left a comment
There was a problem hiding this comment.
Nice catch on the gap — the field-level details all match system_rules.go. Three fixes:
1. Sample output is missing its File: line (all 5 locales). rules_cmd.go:70 prints it before Source:, and the two existing samples in the same doc already show it (en 215/226, zh 194/205, ja 175/186, ko 204/215, ru 219/230):
$ ocr rules check src/main/java/com/example/UserService.java
File: src/main/java/com/example/UserService.java
Source: Project (.opencodereview/rule.json)2. "the same embedded table above" points the wrong way (all 5 locales). The new section sits in ## Rule file format (en ~59); the table is at 161, below it. A link survives future reordering: the same embedded table in [Rule resolution per file](#rule-resolution-per-file).
3. ko: the recipe heading's {#...} is on its own line, so it renders as visible body text. headingId.ts:7 only matches a trailing {#id} on the heading line — otherwise the heading falls back to generateHeadingId(), which strips Hangul entirely and leaves an empty id. That's why all 14 existing ko headings anchor on the same line. Your other new ko heading gets this right.
|
and rebase main @A1oha666 |
c0d835d to
0424234
Compare
Polish the zh/ja/ru localizations of the review rules guide: - zh: reword the five-gate filter as five checks and localize remaining English terms (per-file, default-path gate, fallback), fix a heading grammar slip, tighten verbs, and normalize dashes/punctuation - ja: localize the fallback table label - ru: fix a garbled translation of the per-file filter note and localize the fallback label (switching to half-width parentheses for Russian) Docs only; no code changes.
Co-authored-by: Tao Xin <[email protected]>
Co-authored-by: Tao Xin <[email protected]>
Co-authored-by: Tao Xin <[email protected]>
…ction
Address review feedback:
- Add the missing File: line to the ocr rules check sample output in
all five locales (rules_cmd.go prints it before Source:)
- Point 'the same embedded table' at the actual location via a link to
the Rule resolution per file section instead of the wrong 'above'
- Fold the ko recipe heading's {#...} anchor onto the heading line so
headingId.ts can parse it (a standalone line renders as body text
and generateHeadingId() strips Hangul, yielding an empty id)
Docs only; no code changes.
0424234 to
d0ca2b4
Compare
The cross-references added in the previous commit broke in ja/ko/ru:
generateHeadingId() only keeps ASCII + Han, so the raw heading text
anchor (#ファイルごとのルール解決, #파일별-규칙-해석,
#разрешение-правила-для-файла) never matches the generated id
(stripped to 解決 or empty).
Add explicit {#rule-resolution-per-file} markers to the ja/ru headings
(following the ko doc's existing convention of explicit anchors on
every heading) and point all three locales' links at it. zh keeps the
auto-generated Han anchor, which survives generateHeadingId().
Docs only; no code changes.
The new ja heading 'システムルールとのマージ' is pure kana, which
generateHeadingId() strips to an empty id — colliding with the two
pre-existing empty ids in the same doc and making the TOC link
unaddressable. Give it an explicit {#merging-with-the-system-rule}
marker, matching the id used by the ko/ru translations of the same
heading. en/zh auto-generate usable ids and are unchanged.
The two remaining ja empty ids and eight ru empty ids pre-date this PR
(upstream/main has the same counts); fixing them is out of scope here.
Docs only; no code changes.
|
@lizhengfeng101 Thanks for the review! I’ve applied all 3 requested fixes (added the missing File: lines across all 5 locales, resolved the localized heading anchors, and fixed the ko inline formatting), along with an extra ja anchor fix caught during the audit—rebased onto main, please take another look whenever you have time! |
Closes #1133
Summary
The
merge_system_rulefield has been implemented for a while (ProjectRuleEntry.MergeSystemRule→mergeWithSystemRuleininternal/config/rules/system_rules.go), but the review rules guide never mentioned it —in any of the five locales. The only place it appeared in the repo was
skills/open-code-review/SKILL.md, whichmost users never read.
This PR documents the field in all five locales of the review rules guide.
Changes
In
pages/src/content/docs/{en,zh,ja,ko,ru}/review-rules.md:Field list — the
rulesentry now documents{path, rule, merge_system_rule?}, noting the field isoptional and defaults to
false(replace).New "Merging with the system rule" section — a worked example showing the JSON plus the resulting
ocr rules checkoutput, so the## System-Specific Rules (Mandatory)/## User-Specific Rules (Mandatory)structure is visible. It states that:
**/*entry yieldsjava.mdfor.java,python.mdfor.py, anddefault.mdfor unrecognized extensions;--rule,<repo>/.opencodereview/rule.json, and~/.opencodereview/rule.json);first-match-wins, and a matching layer still shadows lower user layers.
New recipe — "Global security rules on top of the built-in per-language rules", covering the common case
users search for.
Non-English locales are written in their own language (
pages/src/content/docs/**is exempt from theEnglish-only scan per
AGENTS.md).Verification
make testpassesmake checkpasses (license-check, english-check, go vet)No Go code changed — docs only.