Skip to content

Commit 7b523b3

Browse files
authored
Merge pull request #18 from APIOpsCycles/codex/content-integrity-duplicate-warnings
Report duplicate method resources as warnings
2 parents 78013a3 + 4b1e5e2 commit 7b523b3

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎scripts/test-method-content-integrity.mjs‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const localeDirs = readdirSync("src/data/method", { withFileTypes: true })
2424
.filter((entry) => entry.isDirectory())
2525
.map((entry) => entry.name);
2626
const findings = [];
27+
const warnings = [];
2728
const lifecycleStages = new Set(["strategy", "architecture", "design", "delivery", "publishing", "improving"]);
2829

2930
function collectMatchingStringValues(node, pattern, results = new Set()) {
@@ -93,7 +94,7 @@ for (const station of stationGroups) {
9394
}
9495

9596
if (seenResources.has(resourceId)) {
96-
findings.push(
97+
warnings.push(
9798
`Station ${station.id} contains duplicate resource reference "${resourceId}" at indexes ${seenResources.get(resourceId)} and ${index}.`
9899
);
99100
} else {
@@ -236,4 +237,11 @@ if (findings.length > 0) {
236237
process.exit(1);
237238
}
238239

240+
if (warnings.length > 0) {
241+
console.log("Method content validation warnings:");
242+
for (const warning of warnings) {
243+
console.log(`- ${warning}`);
244+
}
245+
}
246+
239247
console.log("Method content validation passed.");

0 commit comments

Comments
 (0)