Improve paths config handling for JS/Python when globs are used

This commit is contained in:
Rasmus Wriedt Larsen
2024-01-04 14:08:57 +01:00
parent e7cc246a11
commit 45dde38030
6 changed files with 38 additions and 14 deletions
+4 -4
View File
@@ -87,9 +87,9 @@ const util = __importStar(require("./util"));
trapCacheDownloadTime: 0,
};
analysisPaths.includeAndExcludeAnalysisPaths(config);
t.is(process.env["LGTM_INDEX_INCLUDE"], "path1\npath2");
t.is(process.env["LGTM_INDEX_INCLUDE"], undefined);
t.is(process.env["LGTM_INDEX_EXCLUDE"], "path4\npath5");
t.is(process.env["LGTM_INDEX_FILTERS"], "include:path1\ninclude:path2\ninclude:**/path3\nexclude:path4\nexclude:path5\nexclude:path6/**");
t.is(process.env["LGTM_INDEX_FILTERS"], "exclude:**/*\ninclude:path1\ninclude:path2\ninclude:**/path3\nexclude:path4\nexclude:path5\nexclude:path6/**");
});
});
(0, ava_1.default)("paths only has globs", async (t) => {
@@ -117,9 +117,9 @@ const util = __importStar(require("./util"));
trapCacheDownloadTime: 0,
};
analysisPaths.includeAndExcludeAnalysisPaths(config);
t.is(process.env["LGTM_INDEX_INCLUDE"], "");
t.is(process.env["LGTM_INDEX_INCLUDE"], undefined);
t.is(process.env["LGTM_INDEX_EXCLUDE"], undefined);
t.is(process.env["LGTM_INDEX_FILTERS"], "include:path1/**\ninclude:**/path2");
t.is(process.env["LGTM_INDEX_FILTERS"], "exclude:**/*\ninclude:path1/**\ninclude:**/path2");
});
});
(0, ava_1.default)("exclude temp dir", async (t) => {