lint/configured/java
A linter is configured
Implements lint/configured for java.
| Severity | warning |
| Tiers | 1, 2 |
| Stacks | java |
| Scope | each |
| Kind | outcome |
| Source | library v0.6.0 |
| Selected by | fleetlint-recommended@v0.6.0 |
Requirement
A static analyzer beyond the compiler is wired into the build (pom.xml, build.gradle(.kts), a parent build or a convention plugin): Checkstyle, Error Prone, SpotBugs or PMD. Another analyzer is added with accept:.
Why
javac accepts swallowed exceptions, star imports and 400-line methods; the analyzer is where they are refused.
Fix
Add the maven-checkstyle-plugin (or Gradle’s checkstyle plugin) with configLocation config/checkstyle/checkstyle.xml; fleetlint fix --apply writes the configuration, the plugin is added by hand.
Agent instruction: Add config/checkstyle/checkstyle.xml from the template and wire maven-checkstyle-plugin in pom.xml (or the checkstyle plugin in build.gradle.kts) with that configLocation and failOnViolation true; fix what it reports.
fleetlint fix can apply this rule’s fix automatically (1 action(s)).
A finding of this rule points at config/checkstyle/checkstyle.xml.
Sources
- https://csrc.nist.gov/pubs/sp/800/218/final (standard, PW.7.2: Perform the code review and/or code analysis based on the organization’s secure coding standards)
- https://fleetlint.org/baseline/#static-analysis (convention)
- https://checkstyle.org/ (spec)
- https://errorprone.info/ (spec)
- https://spotbugs.github.io/ (spec)
- https://pmd.github.io/ (spec)
- https://fleetlint.org/stacks/#java
Generated by fleetlint docs from catalog v0.6.0.