You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b409fff
Browse filesBrowse the repository at this point in the historyBrowse files
fix(devx): check-comment-mask-corpus no longer drops argv[0] when --masker is absent (#17352)
`argv.indexOf('--masker')` returns -1 when the flag is absent, and
-1 + 1 === 0, so the filter computing `rest` treated "no --masker
anywhere" as "drop index 0" -- removing the first argument from the
very list the unknown-option check reads next. An unknown option in
first position (e.g. --no-such-flag) was silently dropped, the usage
check never fired, and the script fell through to a full 6,484-file
sweep, exiting 0 instead of refusing with EXIT_USAGE.
Extracts the computation into argvAfterMasker(argv, maskerFlag),
guarded so `rest` is argv itself (not a filtered copy) when --masker
is absent. --masker in first position is unaffected and unchanged.
Adds 9 --self-test cases (floor 17 -> 26): argvAfterMasker exercised
directly for an unknown option at argv[0], a middle position, and the
position right after --masker, plus real spawned-process assertions
(following the objectui port's approach) pinning the exit code as an
actual number returned by the OS.
Measured before deciding: the issue's suggested patch carried
`&& arg !== '--self-test'`, but --self-test is dispatched by the
entrypoint before main() is ever called, so that clause would be dead
code here -- not ported.
Claude-Session: https://claude.ai/code/session_012GKcPZbMoGq7WPzKLfRBTU
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: scripts/check-comment-mask-corpus.mjs
+88-2Lines changed: 88 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -125,6 +125,7 @@
125
125
126
126
// dispatch-gates: whole-tree-population -- `collectSources` walks every authored JS/TS file from the repo root, so the corpus is the whole tree; the one literal below names the masker this gate exercises, not the files it reads.
0 commit comments