MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / main

Function main

apps/api/scripts/lint-meta/cli.ts:65–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63import { checkRouteFilesHaveTests } from "./rules/testing/routes-require-test-sibling";
64import { checkSkippedTestsHaveTracking } from "./rules/testing/skipped-tests-need-tracking";
65import { checkTouchedTests } from "./rules/testing/touch-tests-too";
66
67const ROOT = resolve(process.cwd());
68
69async function main(): Promise<void> {
70 if (process.argv.includes("--list-rules")) {
71 printRuleCatalog(META_RULES);
72
73 return;
74 }
75
76 const verifyMode = process.argv.includes("--verify");
77 const ctx = buildContext(ROOT);
78 const syncViolations = runMetaRules(META_RULES, ctx);
79
80 if (verifyMode) {
81 console.log("[lint:meta] Verifying action SHAs against github.com…");
82 }
83
84 const violations = [
85 ...syncViolations,
86 ...(verifyMode ? await runMetaRulesAsync(META_RULES, ctx) : []),
87 ];
88
89 if (violations.length === 0) {
90 console.log(
91 verifyMode
92 ? "[lint:meta] No violations. All action SHAs resolve."
93 : "[lint:meta] No violations."
94 );
95
96 return;
97 }
98
99 console.error(`[lint:meta] ${String(violations.length)} violation(s):\n`);
100
101 for (const v of violations) {
102 console.error(` ${v.file}`);
103 console.error(` ${v.rule}: ${v.message}\n`);
104 }
105
106 process.exit(1);

Callers 1

cli.tsFile · 0.70

Calls 5

printRuleCatalogFunction · 0.90
buildContextFunction · 0.90
runMetaRulesFunction · 0.90
runMetaRulesAsyncFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected