seaworthycode 1.2.18 → 1.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -207,6 +207,7 @@ var registry = new CheckRegistry();
|
|
|
207
207
|
var SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
208
208
|
"node_modules",
|
|
209
209
|
".git",
|
|
210
|
+
".claude",
|
|
210
211
|
"dist",
|
|
211
212
|
"build",
|
|
212
213
|
".next",
|
|
@@ -3903,6 +3904,14 @@ function setAnalysisType(finding, analysisType = "pattern") {
|
|
|
3903
3904
|
finding.properties.analysisType = analysisType;
|
|
3904
3905
|
}
|
|
3905
3906
|
var resolveCopy = getCopy;
|
|
3907
|
+
function getTreeSitterMaxFiles() {
|
|
3908
|
+
const env2 = process.env.SEAWORTHY_MECHANICAL_MAX_FILES;
|
|
3909
|
+
if (env2 !== void 0) {
|
|
3910
|
+
const n = parseInt(env2, 10);
|
|
3911
|
+
if (!isNaN(n) && n > 0) return n;
|
|
3912
|
+
}
|
|
3913
|
+
return 2e3;
|
|
3914
|
+
}
|
|
3906
3915
|
function createTreeSitterCheck(options) {
|
|
3907
3916
|
const {
|
|
3908
3917
|
id,
|
|
@@ -3935,13 +3944,19 @@ function createTreeSitterCheck(options) {
|
|
|
3935
3944
|
async run(ctx) {
|
|
3936
3945
|
const findings = [];
|
|
3937
3946
|
const degradedLanguages = /* @__PURE__ */ new Set();
|
|
3938
|
-
const
|
|
3947
|
+
const allEligibleFiles = ctx.files.filter((file) => {
|
|
3939
3948
|
const query = queries[file.language];
|
|
3940
3949
|
if (!query) return false;
|
|
3941
3950
|
if (isMechanicalCheckExcludedPath(file.relativePath)) return false;
|
|
3942
3951
|
if (fileFilter && !fileFilter(file)) return false;
|
|
3943
3952
|
return true;
|
|
3944
3953
|
});
|
|
3954
|
+
const maxFiles = getTreeSitterMaxFiles();
|
|
3955
|
+
let eligibleFiles = allEligibleFiles;
|
|
3956
|
+
if (allEligibleFiles.length > maxFiles) {
|
|
3957
|
+
console.error(`[seaworthy] ${id}: ${allEligibleFiles.length} eligible files \u2014 capping tree-sitter scan to ${maxFiles}`);
|
|
3958
|
+
eligibleFiles = allEligibleFiles.slice(0, maxFiles);
|
|
3959
|
+
}
|
|
3945
3960
|
const fileFindings = await runWithConcurrencyCollect(
|
|
3946
3961
|
eligibleFiles,
|
|
3947
3962
|
async (file) => {
|