@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/index.cjs CHANGED
@@ -769,28 +769,18 @@ async function analyzeFile(filePath, content, changedRanges, ref, githubClient,
769
769
  }
770
770
 
771
771
  // src/utils/test-target-extractor.ts
772
+ var import_minimatch = require("minimatch");
772
773
  async function extractTestTargets(files, githubClient, prHeadRef, config) {
773
774
  info(`Analyzing ${files.length} file(s) for test targets`);
774
775
  const diffs = parsePullRequestFiles(files);
775
- const globToRegex = (pattern) => {
776
- let regexStr = pattern.replace(/\./g, "\\.");
777
- regexStr = regexStr.replace(/\*\*\//g, "__DOUBLE_STAR_SLASH__");
778
- regexStr = regexStr.replace(/\*\*/g, "__DOUBLE_STAR__");
779
- regexStr = regexStr.replace(/\*/g, "[^/]*");
780
- regexStr = regexStr.replace(/__DOUBLE_STAR_SLASH__/g, "(.*/)?");
781
- regexStr = regexStr.replace(/__DOUBLE_STAR__/g, ".*");
782
- return new RegExp(`^${regexStr}$`);
783
- };
784
776
  const filteredDiffs = diffs.filter((diff) => {
785
777
  const matchesInclude = config.includePatterns.some((pattern) => {
786
- const regex = globToRegex(pattern);
787
- return regex.test(diff.filename);
778
+ return (0, import_minimatch.minimatch)(diff.filename, pattern);
788
779
  });
789
780
  if (!matchesInclude)
790
781
  return false;
791
782
  const matchesExclude = config.excludePatterns.some((pattern) => {
792
- const regex = globToRegex(pattern);
793
- return regex.test(diff.filename);
783
+ return (0, import_minimatch.minimatch)(diff.filename, pattern);
794
784
  });
795
785
  return !matchesExclude;
796
786
  });