Pankraz76 commented on PR #2322: URL: https://github.com/apache/maven/pull/2322#issuecomment-2873791586
> * I don't want to introduce additional plugins into the build. > * Format is limited to cosmetics. Check is just file parser too, therefore very limited. Ideally, we would superset what Checkstyle relies on using: - [PMD](https://pmd.github.io/) - [SpotBugs](https://spotbugs.github.io/) It's interesting to see that each tool has its niche: - PMD often passes - SpotBugs really taps in if something is sus [Checkstyle PMD Reference](https://github.com/checkstyle/checkstyle/blob/0a341c4dc53b149ee42c5ddf8e5507d44738c6eb/pom.xml#L211) Trading just a few seconds for higher code standards is generally an effort taken. **Current real world problem:** Missing auto-fix effectively preventing integration. This is where Rewrite kicks in. So we need Rewrite as enabler. --- Ideally `org.openrewrite.staticanalysis.CodeCleanup` would sooner or later: - Fix all violations covered by other tools - Make them kind of obsolete in comparison - Yet keep them very valuable each on their own Even when having the option, running them would make sense to really make sure. Once (and for all) fixed by [Rewrite CodeCleanup](https://docs.openrewrite.org/recipes/staticanalysis/codecleanup), technical debt is considered non-existent anymore. **SpotBugs/PMD** checks for more than 400 bug patterns. While Rewrite aims to: - Cover all existing tools - Automate them (its dedicated super power) Trading CPU time for maintenance and bugs avoidance seems lit. ``` [INFO] --- pmd:3.23.0:check (default) @ maven-api-di --- [INFO] PMD version: 7.0.0 [INFO] PMD Failure: org.apache.maven.api.di.Inject:25 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.ElementType.CONSTRUCTOR'. [INFO] PMD Failure: org.apache.maven.api.di.Inject:26 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.ElementType.FIELD'. [INFO] PMD Failure: org.apache.maven.api.di.Inject:27 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.ElementType.METHOD'. [INFO] PMD Failure: org.apache.maven.api.di.Inject:28 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.RetentionPolicy.RUNTIME'. [INFO] PMD Failure: org.apache.maven.api.di.MojoExecutionScoped:25 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.ElementType.METHOD'. [INFO] PMD Failure: org.apache.maven.api.di.MojoExecutionScoped:26 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.ElementType.TYPE'. [INFO] PMD Failure: org.apache.maven.api.di.MojoExecutionScoped:27 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.RetentionPolicy.RUNTIME'. [INFO] PMD Failure: org.apache.maven.api.di.Named:24 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.RetentionPolicy.RUNTIME'. [INFO] PMD Failure: org.apache.maven.api.di.Priority:25 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.ElementType.METHOD'. [INFO] PMD Failure: org.apache.maven.api.di.Priority:26 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.ElementType.TYPE'. [INFO] PMD Failure: org.apache.maven.api.di.Priority:27 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.RetentionPolicy.RUNTIME'. [INFO] PMD Failure: org.apache.maven.api.di.Provides:25 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.ElementType.METHOD'. [INFO] PMD Failure: org.apache.maven.api.di.Provides:26 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.RetentionPolicy.RUNTIME'. [INFO] PMD Failure: org.apache.maven.api.di.Qualifier:25 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.ElementType.ANNOTATION_TYPE'. [INFO] PMD Failure: org.apache.maven.api.di.Qualifier:26 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.RetentionPolicy.RUNTIME'. [INFO] PMD Failure: org.apache.maven.api.di.Scope:25 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.ElementType.ANNOTATION_TYPE'. [INFO] PMD Failure: org.apache.maven.api.di.Scope:26 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.RetentionPolicy.RUNTIME'. [INFO] PMD Failure: org.apache.maven.api.di.SessionScoped:25 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.ElementType.METHOD'. [INFO] PMD Failure: org.apache.maven.api.di.SessionScoped:26 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.ElementType.TYPE'. [INFO] PMD Failure: org.apache.maven.api.di.SessionScoped:27 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.RetentionPolicy.RUNTIME'. [INFO] PMD Failure: org.apache.maven.api.di.Singleton:24 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.RetentionPolicy.RUNTIME'. [INFO] PMD Failure: org.apache.maven.api.di.Typed:25 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.ElementType.FIELD'. [INFO] PMD Failure: org.apache.maven.api.di.Typed:26 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.ElementType.METHOD'. [INFO] PMD Failure: org.apache.maven.api.di.Typed:27 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.ElementType.TYPE'. [INFO] PMD Failure: org.apache.maven.api.di.Typed:28 Rule:UnnecessaryImport Priority:4 Unused static import 'java.lang.annotation.RetentionPolicy.RUNTIME'. ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org