@kakarot-ci/core 0.6.1 → 0.6.2
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/cli/index.js +3 -13
- package/dist/cli/index.js.map +2 -2
- package/dist/index.cjs +3 -13
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +3 -13
- package/dist/index.js.map +2 -2
- package/dist/src/utils/test-target-extractor.d.ts.map +1 -1
- package/package.json +2 -1
package/dist/cli/index.js
CHANGED
|
@@ -713,28 +713,18 @@ async function analyzeFile(filePath, content, changedRanges, ref, githubClient,
|
|
|
713
713
|
}
|
|
714
714
|
|
|
715
715
|
// src/utils/test-target-extractor.ts
|
|
716
|
+
import { minimatch } from "minimatch";
|
|
716
717
|
async function extractTestTargets(files, githubClient, prHeadRef, config) {
|
|
717
718
|
info(`Analyzing ${files.length} file(s) for test targets`);
|
|
718
719
|
const diffs = parsePullRequestFiles(files);
|
|
719
|
-
const globToRegex = (pattern) => {
|
|
720
|
-
let regexStr = pattern.replace(/\./g, "\\.");
|
|
721
|
-
regexStr = regexStr.replace(/\*\*\//g, "__DOUBLE_STAR_SLASH__");
|
|
722
|
-
regexStr = regexStr.replace(/\*\*/g, "__DOUBLE_STAR__");
|
|
723
|
-
regexStr = regexStr.replace(/\*/g, "[^/]*");
|
|
724
|
-
regexStr = regexStr.replace(/__DOUBLE_STAR_SLASH__/g, "(.*/)?");
|
|
725
|
-
regexStr = regexStr.replace(/__DOUBLE_STAR__/g, ".*");
|
|
726
|
-
return new RegExp(`^${regexStr}$`);
|
|
727
|
-
};
|
|
728
720
|
const filteredDiffs = diffs.filter((diff) => {
|
|
729
721
|
const matchesInclude = config.includePatterns.some((pattern) => {
|
|
730
|
-
|
|
731
|
-
return regex.test(diff.filename);
|
|
722
|
+
return minimatch(diff.filename, pattern);
|
|
732
723
|
});
|
|
733
724
|
if (!matchesInclude)
|
|
734
725
|
return false;
|
|
735
726
|
const matchesExclude = config.excludePatterns.some((pattern) => {
|
|
736
|
-
|
|
737
|
-
return regex.test(diff.filename);
|
|
727
|
+
return minimatch(diff.filename, pattern);
|
|
738
728
|
});
|
|
739
729
|
return !matchesExclude;
|
|
740
730
|
});
|