@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/index.js
CHANGED
|
@@ -703,28 +703,18 @@ async function analyzeFile(filePath, content, changedRanges, ref, githubClient,
|
|
|
703
703
|
}
|
|
704
704
|
|
|
705
705
|
// src/utils/test-target-extractor.ts
|
|
706
|
+
import { minimatch } from "minimatch";
|
|
706
707
|
async function extractTestTargets(files, githubClient, prHeadRef, config) {
|
|
707
708
|
info(`Analyzing ${files.length} file(s) for test targets`);
|
|
708
709
|
const diffs = parsePullRequestFiles(files);
|
|
709
|
-
const globToRegex = (pattern) => {
|
|
710
|
-
let regexStr = pattern.replace(/\./g, "\\.");
|
|
711
|
-
regexStr = regexStr.replace(/\*\*\//g, "__DOUBLE_STAR_SLASH__");
|
|
712
|
-
regexStr = regexStr.replace(/\*\*/g, "__DOUBLE_STAR__");
|
|
713
|
-
regexStr = regexStr.replace(/\*/g, "[^/]*");
|
|
714
|
-
regexStr = regexStr.replace(/__DOUBLE_STAR_SLASH__/g, "(.*/)?");
|
|
715
|
-
regexStr = regexStr.replace(/__DOUBLE_STAR__/g, ".*");
|
|
716
|
-
return new RegExp(`^${regexStr}$`);
|
|
717
|
-
};
|
|
718
710
|
const filteredDiffs = diffs.filter((diff) => {
|
|
719
711
|
const matchesInclude = config.includePatterns.some((pattern) => {
|
|
720
|
-
|
|
721
|
-
return regex.test(diff.filename);
|
|
712
|
+
return minimatch(diff.filename, pattern);
|
|
722
713
|
});
|
|
723
714
|
if (!matchesInclude)
|
|
724
715
|
return false;
|
|
725
716
|
const matchesExclude = config.excludePatterns.some((pattern) => {
|
|
726
|
-
|
|
727
|
-
return regex.test(diff.filename);
|
|
717
|
+
return minimatch(diff.filename, pattern);
|
|
728
718
|
});
|
|
729
719
|
return !matchesExclude;
|
|
730
720
|
});
|