MCPcopy Create free account
hub / github.com/denoland/std / checkDocs

Function checkDocs

_tools/check_docs.ts:421–450  ·  view source on GitHub ↗
(specifiers: string[])

Source from the content-addressed store, hash-verified

419}
420
421export async function checkDocs(specifiers: string[]) {
422 const { success, stderr } = await new Deno.Command(Deno.execPath(), {
423 args: ["doc", "--lint", ...specifiers],
424 stdin: "inherit",
425 stdout: "inherit",
426 stderr: "piped",
427 }).output();
428 if (!success) {
429 throw new Error(new TextDecoder().decode(stderr));
430 }
431
432 await assertDocs(specifiers);
433
434 if (diagnostics.length > 0) {
435 const errors = distinctBy(diagnostics, (e) => e.message + e.cause);
436 for (const error of errors) {
437 // deno-lint-ignore no-console
438 console.error(
439 `%c[error] %c${error.message} %cat ${error.cause}`,
440 "color: red",
441 "",
442 "color: gray",
443 );
444 }
445
446 // deno-lint-ignore no-console
447 console.log(`%c${errors.length} errors found`, "color: red");
448 Deno.exit(1);
449 }
450}
451
452if (import.meta.main) {
453 const specifiers = (await getEntrypoints())

Callers 1

check_docs.tsFile · 0.85

Calls 2

assertDocsFunction · 0.85
distinctByFunction · 0.85

Tested by

no test coverage detected