fix(metrics): enforce exact runtime inventory

This commit is contained in:
Tam Nhu Tran committed 2026-07-26 09:36:00 -04:00
1 parent 426dc541a9
commit 306a8276b3
7 files changed
+258 -160

No files matched your search

+2 -8
View File
@@ -24,6 +24,7 @@
const fs = require('fs');
const path = require('path');
const { isTestFile } = require('./runtime-source-classifier.js');
const SOURCE_EXTENSIONS = new Set(['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs']);
@@ -79,14 +80,6 @@ function isSourceFile(filePath) {
return SOURCE_EXTENSIONS.has(path.extname(filePath));
}
function isTestFile(relPath) {
return (
/(?:^|\/)(?:__tests__|tests?)\//.test(relPath) ||
/\.test\./.test(relPath) ||
/\.spec\./.test(relPath)
);
}
function isCliUxExempt(relPath) {
return CLI_UX_EXEMPT_PREFIXES.some(function (prefix) {
return relPath.startsWith(prefix);
@@ -350,6 +343,7 @@ module.exports = {
classifyThrows: classifyThrows,
countConsoleErrors: countConsoleErrors,
hasCreateLogger: hasCreateLogger,
isTestFile: isTestFile,
countLoc: countLoc,
TYPED_ERROR_CLASSES: TYPED_ERROR_CLASSES,
TYPED_ADOPTION_SUBDOMAINS: TYPED_ADOPTION_SUBDOMAINS,