scripts(closing-keywords): a disclaimer wrapped at 79 columns reads as a claim #2245
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!2245
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/1120-0232"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
A pull-request body that disclaims a close, hard wrapped at 80 columns, was read as a claim by both parsers — the checker called it safe and the sweeper would have closed the request itself.
What was wrong
Both
scripts/check-closing-keywords.jsandscripts/close-merged-issues.jsread the clause before a keyword as the text after the last line break:Wrapped prose puts the negation and the issue number on different lines, so
NEGATIONwas handed an empty string andCLAIM_STARTsaw a line start. The same sentence gives opposite verdicts:The wrapped form is the severe one:
parseClosingKeywordsreturns the number, soclose-merged-issues.jsposts the comment and closes the request — the exact accident this tooling exists to prevent.What changed
clauseBefore()in both scripts: a line break is still a boundary forCLAIM_START(a claim really can open a line), but when the text immediately before the keyword carries no word of its own, the clause continues on the line above. The two parsers keep the same rule, sotest/closing-keywords.test.js's "held in step" section still holds.Tests
test/closing-keywords.test.js— 35 assertions, 0 failed. Six new ones: the wrapped disclaimer is flaggednegated, the sweeper no longer cites it fornotand forcannot, plus controls that a claim after a full stop, two claims on two lines, and a claim following an unrelated negation still parse.test/close-merged-issues.test.js— 81 assertions, 0 failed.npm test— 395 suites, 13,222 assertions, 0 failed.node scripts/syntax-check.js— 475 files, all OK.Scope
Latent, not a live miss: none of the last 50 merged bodies has a keyword opening a wrapped line. Nothing here changes which issues are open.
Refs #130