Skip to content

Commit eac304d

Browse files
committed
fix: address PR review comments
- Remove duplicate suppress block in additional-operations.ts - Add operation-map.json existence check in coverage script - Update guidance to mention PascalCase region names - Clean up missing-examples.json on full coverage - Gitignore missing-examples.json (CI artifact)
1 parent 078f083 commit eac304d

File tree

3 files changed

+16
-26
lines changed

3 files changed

+16
-26
lines changed

.gitignore

208 Bytes
Binary file not shown.

examples/additional-operations.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -320,26 +320,3 @@ void createDocumentExample;
320320
void createDocumentsExample;
321321
void getDocumentExample;
322322
void searchUserTaskEffectiveVariablesExample;
323-
324-
// Suppress "declared but never read"
325-
void getDecisionDefinitionXmlExample;
326-
void getDecisionInstanceExample;
327-
void searchDecisionInstancesExample;
328-
void deleteDecisionInstanceExample;
329-
void getDecisionRequirementsExample;
330-
void getDecisionRequirementsXmlExample;
331-
void searchDecisionRequirementsExample;
332-
void createDocumentLinkExample;
333-
void deleteDocumentExample;
334-
void throwJobErrorExample;
335-
void updateJobExample;
336-
void searchJobsExample;
337-
void getUserTaskExample;
338-
void updateUserTaskExample;
339-
void getUserTaskFormExample;
340-
void searchUserTaskVariablesExample;
341-
void searchUserTaskAuditLogsExample;
342-
void createDocumentExample;
343-
void createDocumentsExample;
344-
void getDocumentExample;
345-
void searchUserTaskEffectiveVariablesExample;

scripts/check-example-coverage.cjs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ if (!fs.existsSync(specPath)) {
2222
}
2323

2424
const spec = JSON.parse(fs.readFileSync(specPath, 'utf8'));
25+
26+
if (!fs.existsSync(mapPath)) {
27+
console.error(`Operation map not found at ${mapPath}`);
28+
console.error('Ensure examples/operation-map.json exists and is committed.');
29+
process.exit(2);
30+
}
31+
2532
const operationMap = JSON.parse(fs.readFileSync(mapPath, 'utf8'));
2633

2734
const HTTP_METHODS = new Set(['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace']);
@@ -57,13 +64,19 @@ if (missing.length > 0) {
5764
}
5865

5966
console.log(`\nTo fix this:`);
60-
console.log(` 1. Add an example for each missing operation in examples/`);
61-
console.log(` Wrap code in //#region <OperationId> ... //#endregion <OperationId> tags`);
62-
console.log(` 2. Add an entry to examples/operation-map.json for each operation`);
67+
console.log(` 1. Add an example for each missing operation in examples/,`);
68+
console.log(` wrapping the code in //#region <RegionName> ... //#endregion <RegionName> tags`);
69+
console.log(` (pick a RegionName, typically PascalCase, e.g. CreateUser).`);
70+
console.log(` 2. Add or update an entry in examples/operation-map.json mapping the operationId`);
71+
console.log(` to the chosen RegionName.`);
6372
console.log(` 3. Or use the Copilot prompt: .github/prompts/add-missing-examples.prompt.md`);
6473

6574
fs.writeFileSync(path.join(rootDir, 'missing-examples.json'), JSON.stringify(missing, null, 2));
6675
process.exit(1);
6776
} else {
6877
console.log('\nFull coverage!');
78+
const missingPath = path.join(rootDir, 'missing-examples.json');
79+
if (fs.existsSync(missingPath)) {
80+
fs.unlinkSync(missingPath);
81+
}
6982
}

0 commit comments

Comments
 (0)