Skip to content

Commit c0b453e

Browse files
committed
docs(path-guard): sync paths-allowlist.yml schema docs to canonical
The schema docs in paths-allowlist.yml drifted from canonical (socket-btm). The old comment claimed line tolerance is ±2 (FALSE since Gap 2; lines are now strict-exact) and made no mention of snippet_hash or --show-hashes. Sync the canonical comment fleet-wide so contributors authoring exemptions have accurate guidance.
1 parent 257a750 commit c0b453e

1 file changed

Lines changed: 23 additions & 9 deletions

File tree

.github/paths-allowlist.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,35 @@
77
#
88
# Schema (all top-level keys optional except `reason`):
99
#
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.
1520
#
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.
1933
#
2034
# Example:
2135
#
2236
# - rule: A
2337
# file: packages/foo/scripts/legacy-build.mts
24-
# line: 42
38+
# snippet_hash: a1b2c3d4e5f6
2539
# pattern: "path.join(testDir, 'out', 'Final')"
2640
# reason: |
2741
# legacy-build.mts is scheduled for removal in v2.0; refactoring

0 commit comments

Comments
 (0)