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

Function collectSourceFiles

apps/api/scripts/lint-meta/context.ts:30–62  ·  view source on GitHub ↗
(
  dir: string,
  skipSubpaths: readonly string[] = TESTS_LINT_META_SKIP
)

Source from the content-addressed store, hash-verified

28}
29
30export function collectSourceFiles(
31 dir: string,
32 skipSubpaths: readonly string[] = TESTS_LINT_META_SKIP
33): string[] {
34 const out: string[] = [];
35 let entries: string[];
36
37 try {
38 entries = readdirSync(dir);
39 } catch {
40 return out;
41 }
42
43 for (const entry of entries) {
44 const full = join(dir, entry);
45 const stat = statSync(full);
46
47 if (stat.isDirectory()) {
48 if (shouldSkipDirectory(full, skipSubpaths)) {
49 continue;
50 }
51
52 out.push(...collectSourceFiles(full, skipSubpaths));
53 continue;
54 }
55
56 if (stat.isFile() && SOURCE_EXTENSIONS.has(extname(full))) {
57 out.push(full);
58 }
59 }
60
61 return out;
62}
63
64export function findWorkflows(dir: string): string[] {
65 const out: string[] = [];

Callers 5

checkLogicFilesHaveTestsFunction · 0.90
checkRouteFilesHaveTestsFunction · 0.90
buildContextFunction · 0.70
lint-meta.test.tsFile · 0.50

Calls 2

shouldSkipDirectoryFunction · 0.70
hasMethod · 0.45

Tested by

no test coverage detected