Skip to content

Commit 477bc2f

Browse files
committed
fix(audit): keep audit-allow directive pending across non-matching findings
1 parent 164e69d commit 477bc2f

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

workers/src/orchestrate.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,13 +1956,11 @@ async function runAudit(
19561956
// Reset link-finder regex state per line
19571957
MARKDOWN_LINK_RE.lastIndex = 0;
19581958
let linkMatch: RegExpExecArray | null;
1959-
let lineHadFinding = false;
19601959
while ((linkMatch = MARKDOWN_LINK_RE.exec(line)) !== null) {
19611960
const target = linkMatch[2];
19621961

19631962
const finding = classifyLink(target, path, lineIdx + 1, isWriting, uriResolves);
19641963
if (!finding) continue;
1965-
lineHadFinding = true;
19661964

19671965
// Apply pending suppression if the rule matches
19681966
if (pendingSuppress && pendingSuppress.rule === finding.rule_id) {
@@ -1980,16 +1978,6 @@ async function runAudit(
19801978
break;
19811979
}
19821980
}
1983-
1984-
// If the directive sat on an earlier line and we've now seen a
1985-
// finding-producing link on a later line that wasn't a matching
1986-
// rule, drop the pending suppression so it doesn't apply to an
1987-
// unrelated link. Out-of-scope links (external URLs, anchors,
1988-
// resolvable klappy:// URIs) produce no finding and must not
1989-
// expire the directive.
1990-
if (pendingSuppress && pendingSuppress.lineSeen < lineIdx + 1 && lineHadFinding) {
1991-
pendingSuppress = null;
1992-
}
19931981
}
19941982
}
19951983

0 commit comments

Comments
 (0)