MCPcopy Index your code
hub / github.com/freshframework/fresh / checkDocs

Function checkDocs

tools/check_docs_lib.ts:353–382  ·  view source on GitHub ↗
(specifiers: string[])

Source from the content-addressed store, hash-verified

351}
352
353export async function checkDocs(specifiers: string[]) {
354 const { success, stderr } = await new Deno.Command(Deno.execPath(), {
355 args: ["doc", "--lint", ...specifiers],
356 stdin: "inherit",
357 stdout: "inherit",
358 stderr: "piped",
359 }).output();
360 if (!success) {
361 throw new Error(new TextDecoder().decode(stderr));
362 }
363
364 await assertDocs(specifiers);
365
366 if (diagnostics.length > 0) {
367 const errors = distinctBy(diagnostics, (e) => e.message + e.cause);
368 for (const error of errors) {
369 // deno-lint-ignore no-console
370 console.error(
371 `%c[error] %c${error.message} %cat ${error.cause}`,
372 "color: red",
373 "",
374 "color: gray",
375 );
376 }
377
378 // deno-lint-ignore no-console
379 console.log(`%c${errors.length} errors found`, "color: red");
380 Deno.exit(1);
381 }
382}

Callers 1

check_docs.tsFile · 0.90

Calls 2

assertDocsFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected