|
7 | 7 | # |
8 | 8 | # Schema (all top-level keys optional except `reason`): |
9 | 9 | # |
10 | | -# - rule: Rule letter (A, B, C, D, F, G). Omit to match any rule. |
11 | | -# file: Substring match against the relative file path. |
12 | | -# pattern: Substring match against the offending snippet. |
13 | | -# line: Line number; matches if within ±2 of the finding. |
14 | | -# reason: Why this site is genuinely exempt. Required. |
| 10 | +# - rule: Rule letter (A, B, C, D, F, G). Omit to match any rule. |
| 11 | +# file: Substring match against the relative file path. |
| 12 | +# pattern: Substring match against the offending snippet. |
| 13 | +# line: Exact line number. Strict — no fuzz tolerance. |
| 14 | +# snippet_hash: 12-char SHA-256 prefix of the normalized snippet |
| 15 | +# (whitespace collapsed). Drift-resistant: the entry |
| 16 | +# keeps matching after reformatting that doesn't |
| 17 | +# change the offending construction. Get the hash by |
| 18 | +# running `node scripts/check-paths.mts --show-hashes`. |
| 19 | +# reason: Why this site is genuinely exempt. Required. |
15 | 20 | # |
16 | | -# Prefer narrow entries (rule + file + line + pattern) over blanket |
17 | | -# `file:` entries that exempt the whole file. Genuine exemptions are |
18 | | -# rare — most "false positives" should be reported as gate bugs. |
| 21 | +# Match policy: if `line` is provided it must match exactly. If |
| 22 | +# `snippet_hash` is provided it must match exactly. Both may be set — |
| 23 | +# either one matching is sufficient (so a code reformat that keeps |
| 24 | +# the snippet but moves the line still matches via hash, and a |
| 25 | +# reformat that changes the snippet but keeps the line still matches |
| 26 | +# via line). If neither is set, `file` + `pattern` + `rule` matching |
| 27 | +# is used (broader; prefer narrow entries when possible). |
| 28 | +# |
| 29 | +# Prefer narrow entries (rule + file + snippet_hash + pattern) over |
| 30 | +# blanket `file:` entries that exempt the whole file. Genuine |
| 31 | +# exemptions are rare — most "false positives" should be reported |
| 32 | +# as gate bugs. |
19 | 33 | # |
20 | 34 | # Example: |
21 | 35 | # |
22 | 36 | # - rule: A |
23 | 37 | # file: packages/foo/scripts/legacy-build.mts |
24 | | -# line: 42 |
| 38 | +# snippet_hash: a1b2c3d4e5f6 |
25 | 39 | # pattern: "path.join(testDir, 'out', 'Final')" |
26 | 40 | # reason: | |
27 | 41 | # legacy-build.mts is scheduled for removal in v2.0; refactoring |
|
0 commit comments