Skip to content

Commit f5f4e03

Browse files
Strum355claude
andcommitted
fix(workspace): handle Java PathMatcher glob quirk for root-level paths
Java's PathMatcher glob **/X/** doesn't match when X is the first path component. Add fallback matchers without the leading **/ prefix. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8baed69 commit f5f4e03

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/main/java/io/github/guacsec/trustifyda/utils/WorkspaceUtils.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,17 @@ public static List<Path> filterByIgnorePatterns(
4343

4444
List<PathMatcher> matchers =
4545
ignorePatterns.stream()
46-
.map(p -> FileSystems.getDefault().getPathMatcher("glob:" + p))
46+
.flatMap(
47+
p -> {
48+
var fs = FileSystems.getDefault();
49+
java.util.stream.Stream.Builder<PathMatcher> b =
50+
java.util.stream.Stream.builder();
51+
b.add(fs.getPathMatcher("glob:" + p));
52+
if (p.startsWith("**/")) {
53+
b.add(fs.getPathMatcher("glob:" + p.substring(3)));
54+
}
55+
return b.build();
56+
})
4757
.toList();
4858

4959
return manifests.stream()

0 commit comments

Comments
 (0)