Skip to content

Commit 62a6583

Browse files
sbryngelsonclaude
andcommitted
Tighten param prefix check to require structural boundary
Match family prefixes only at structural boundaries to avoid silently accepting typos like patch_ic as valid. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 298c7a8 commit 62a6583

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

toolchain/mfc/lint_docs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ def _is_valid_param(param: str, valid_params: set, sub_params: set) -> bool:
136136
if sub in sub_params:
137137
return True
138138

139-
# Family prefix check
140-
if any(p.startswith(base) for p in valid_params):
139+
# Family prefix check (only accept at a boundary to avoid prefix-typo matches)
140+
if any(p.startswith(base + b) for b in ("(", "%", "_") for p in valid_params):
141141
return True
142142

143143
return False

0 commit comments

Comments
 (0)