Skip to content

Commit

Permalink
Ignore package-info.java and module-info.java
Browse files Browse the repository at this point in the history
  • Loading branch information
shitikanth committed Dec 24, 2024
1 parent 1c8ce38 commit 4ccfdf9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package io.github.shitikanth.example;
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,15 @@ private void analyzeSourceRoots(List<Path> sourceRoots) throws EnforcerRuleExcep
long startTime = System.currentTimeMillis();
LOGGER.info("Analyzing {} files", sourceFiles.size());
executor = Executors.newFixedThreadPool(4);
executor.invokeAll(sourceFiles.stream().map(
executor.invokeAll(sourceFiles.stream()
.filter(path -> {
String fileName = null;
if (path.getFileName() != null) {
fileName = path.getFileName().toString();
}
return fileName != null && !fileName.equals("package-info.java") && !fileName.equals("module-info.java");
})
.map(
path -> (Callable<AnalysisResult>) () -> {
boolean isEmpty = analyzer.isEmptyJavaFile(path);
return new AnalysisResult(path, isEmpty);
Expand Down

0 comments on commit 4ccfdf9

Please sign in to comment.