File tree Expand file tree Collapse file tree 1 file changed +13
-18
lines changed
shared/src/main/kotlin/org/javacs/kt Expand file tree Collapse file tree 1 file changed +13
-18
lines changed Original file line number Diff line number Diff line change @@ -53,26 +53,21 @@ class SourceExclusions(
53
53
.mapNotNull { if (file.startsWith(it)) it.relativize(file) else null }
54
54
.flatten()
55
55
56
- // Check if we're in a target directory
57
- if (relativePaths.contains(Path .of(" target" ))) {
58
- val pathList = relativePaths.toList()
59
- val targetIndex = pathList.indexOf(Path .of(" target" ))
60
-
61
- // Allow only target directory itself or if next directory is generated-sources
62
- return pathList.size <= targetIndex + 1 ||
63
- pathList[targetIndex + 1 ] == Path .of(" generated-sources" )
56
+ val isIncluded = when {
57
+ // Check if we're in a target directory
58
+ relativePaths.contains(Path .of(" target" )) -> {
59
+ val pathList = relativePaths.toList()
60
+ val targetIndex = pathList.indexOf(Path .of(" target" ))
61
+ // Allow only target directory itself or if next directory is generated-sources
62
+ pathList.size <= targetIndex + 1 || pathList[targetIndex + 1 ] == Path .of(" generated-sources" )
63
+ }
64
+ // Check exclusion patterns
65
+ exclusionMatchers.any { matcher -> relativePaths.any(matcher::matches) } -> false
66
+ // Include paths outside target directory by default
67
+ else -> true
64
68
}
65
69
66
- // If path matches any exclusion pattern, exclude it
67
- if (exclusionMatchers.any { matcher ->
68
- relativePaths.any(matcher::matches)
69
- }) {
70
- return false
71
- }
72
-
73
- // Include paths outside target directory by default
74
- return true
70
+ return isIncluded
75
71
}
76
-
77
72
}
78
73
You can’t perform that action at this time.
0 commit comments