MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / lintFile

Function lintFile

scripts/lint-mermaid/lint-mermaid.mjs:135–147  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

133}
134
135async function lintFile(file) {
136 const text = await readFile(file, 'utf8');
137 const blocks = extractBlocks(text);
138 const errors = [];
139 for (const block of blocks) {
140 try {
141 await mermaid.parse(block.body);
142 } catch (err) {
143 errors.push(formatError(err, file, block));
144 }
145 }
146 return errors;
147}
148
149async function main() {
150 const args = process.argv.slice(2);

Callers

nothing calls this directly

Calls 4

extractBlocksFunction · 0.85
formatErrorFunction · 0.85
pushMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected