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

Function main

apps/ui/scripts/lint-meta/cli.ts:23–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21const ROOT = resolve(process.cwd());
22
23async function main(): Promise<void> {
24 if (process.argv.includes("--list-rules")) {
25 printRuleCatalog(META_RULES);
26
27 return;
28 }
29
30 const verifyMode = process.argv.includes("--verify");
31 const ctx = buildContext(ROOT);
32 const syncViolations = runMetaRules(META_RULES, ctx);
33
34 if (verifyMode) {
35 console.log("[lint:meta] Verifying action SHAs against github.com…");
36 }
37
38 const violations = [
39 ...syncViolations,
40 ...(verifyMode ? await runMetaRulesAsync(META_RULES, ctx) : [])
41 ];
42
43 if (violations.length === 0) {
44 console.log(
45 verifyMode
46 ? "[lint:meta] No violations. All action SHAs resolve."
47 : "[lint:meta] No violations."
48 );
49
50 return;
51 }
52
53 console.error(`[lint:meta] ${String(violations.length)} violation(s):\n`);
54
55 for (const v of violations) {
56 console.error(` ${v.file}`);
57 console.error(` ${v.rule}: ${v.message}\n`);
58 }
59
60 process.exit(1);
61}
62
63if (
64 process.argv[1] !== undefined &&

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