Skip to content

Commit e2ba43e

Browse files
committed
fix: satisfy PR context lint
1 parent df5ec9e commit e2ba43e

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎scripts/github/barnacle-auto-response.mjs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ function hasMostlyBlankTemplate(body) {
346346
return (
347347
(hasLegacyTemplateIntro && legacyEmptyFields >= 3 && emptyClosingRef) ||
348348
(hasNewTemplateIntro &&
349-
!hasAuthoredPullRequestSection(body, "What Problem This Solves") &&
350-
!hasAuthoredPullRequestSection(body, "Evidence"))
349+
!hasAuthoredPullRequestSection("What Problem This Solves", body) &&
350+
!hasAuthoredPullRequestSection("Evidence", body))
351351
);
352352
}
353353

@@ -376,7 +376,7 @@ function hasConcreteBehaviorContext(body, text) {
376376
if (hasLinkedReference(text)) {
377377
return true;
378378
}
379-
if (hasAuthoredPullRequestSection(body, "What Problem This Solves")) {
379+
if (hasAuthoredPullRequestSection("What Problem This Solves", body)) {
380380
return true;
381381
}
382382
if (

‎scripts/github/real-behavior-proof-policy.mjs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ export function extractEvidenceSections(body = "") {
293293
return extractMarkdownSections(/^#{2,6}\s+evidence\b[^\n]*$/im, body);
294294
}
295295

296-
export function hasAuthoredPullRequestSection(body = "", heading) {
296+
export function hasAuthoredPullRequestSection(heading, body = "") {
297297
const headingPattern = new RegExp(`^#{2,6}\\s+${escapeRegex(heading)}\\b[^\\n]*$`, "im");
298298
return !isMissingValue(extractMarkdownSections(headingPattern, body).at(-1) ?? "");
299299
}
@@ -438,11 +438,11 @@ export function evaluatePullRequestContext({ pullRequest } = {}) {
438438

439439
const body = pullRequest?.body ?? "";
440440
const latestLegacyProof = extractLegacyProofSections(body).at(-1) ?? "";
441-
const hasAuthoredProblem = hasAuthoredPullRequestSection(body, "What Problem This Solves");
441+
const hasAuthoredProblem = hasAuthoredPullRequestSection("What Problem This Solves", body);
442442
const hasLegacyProblem = !isMissingValue(
443443
extractFieldValue(latestLegacyProof, legacyProofFields.problem),
444444
);
445-
const hasAuthoredEvidence = hasAuthoredPullRequestSection(body, "Evidence");
445+
const hasAuthoredEvidence = hasAuthoredPullRequestSection("Evidence", body);
446446
const hasLegacyEvidence = !isMissingValue(
447447
extractFieldValue(latestLegacyProof, legacyProofFields.evidence),
448448
);

0 commit comments

Comments
 (0)