Harden scans and add LOC comparison endpoint (#1)
ci / test (push) Successful in 9s

Co-authored-by: luna <clawy@reversed.dev>
Co-committed-by: luna <clawy@reversed.dev>
This commit was merged in pull request #1.
This commit is contained in:
2026-07-21 19:33:08 +02:00
committed by Luna
parent ecc1578b92
commit 91c0ed7332
12 changed files with 276 additions and 29 deletions
+12 -1
View File
@@ -51,7 +51,18 @@ const ignoredFileNames = new Set([
"yarn.lock"
]);
const ignoredDirectoryNames = new Set([
".angular", ".cache", ".next", ".nuxt", ".output", ".parcel-cache", ".svelte-kit",
".terraform", ".venv", "bower_components", "build", "coverage", "dist", "node_modules",
"out", "pods", "target", "vendor"
]);
export function shouldIgnoreCountFile(filePath: string): boolean {
const fileName = path.basename(filePath).toLowerCase();
return ignoredFileNames.has(fileName);
const directories = path.dirname(filePath).toLowerCase().split(path.sep);
return ignoredFileNames.has(fileName)
|| directories.some((directory) => ignoredDirectoryNames.has(directory))
|| /\.(generated|designer|g|pb)\.[^.]+$/.test(fileName)
|| /\.min\.(css|js|mjs|cjs)$/.test(fileName)
|| fileName.endsWith(".snap");
}