Skip to content

Commit 11de278

Browse files
committed
ci(lint): align coverage checks with npm-only parser
Coverage-producer detection still used the removed known-script parameter, so lint failed before workflow validation could run.
1 parent c40b97f commit 11de278

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

scripts/verify-exercised-tests.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -653,10 +653,9 @@ function invokesCoverageCollector (command) {
653653

654654
/**
655655
* @param {Record<string, string>} scripts
656-
* @param {Set<string>} knownScripts
657656
* @returns {Set<string>}
658657
*/
659-
function findCoverageScripts (scripts, knownScripts) {
658+
function findCoverageScripts (scripts) {
660659
const coverageScripts = new Set()
661660
let foundCoverage
662661

@@ -667,7 +666,7 @@ function findCoverageScripts (scripts, knownScripts) {
667666

668667
if (
669668
invokesCoverageCollector(command) ||
670-
extractScriptInvocations(command, knownScripts).some(invocation => coverageScripts.has(invocation.script))
669+
extractScriptInvocations(command).some(invocation => coverageScripts.has(invocation.script))
671670
) {
672671
coverageScripts.add(name)
673672
foundCoverage = true
@@ -680,14 +679,13 @@ function findCoverageScripts (scripts, knownScripts) {
680679

681680
/**
682681
* @param {string} command
683-
* @param {Set<string>} knownScripts
684682
* @param {Set<string>} coverageScripts
685683
* @returns {boolean}
686684
*/
687-
function commandProducesCoverage (command, knownScripts, coverageScripts) {
685+
function commandProducesCoverage (command, coverageScripts) {
688686
if (invokesCoverageCollector(command)) return true
689687

690-
return extractScriptInvocations(command, knownScripts)
688+
return extractScriptInvocations(command)
691689
.some(invocation => coverageScripts.has(invocation.script))
692690
}
693691

@@ -1142,9 +1140,9 @@ function main () {
11421140
}
11431141

11441142
const coverageProducerJobs = new Set()
1145-
const coverageScripts = findCoverageScripts(scripts, knownScripts)
1143+
const coverageScripts = findCoverageScripts(scripts)
11461144
for (const run of workflowRuns) {
1147-
if (commandProducesCoverage(run.run, knownScripts, coverageScripts)) {
1145+
if (commandProducesCoverage(run.run, coverageScripts)) {
11481146
coverageProducerJobs.add(`${run.workflowFile}#${run.jobId}`)
11491147
}
11501148
}

0 commit comments

Comments
 (0)