fleetlint Policy for a fleet of repositories
v0.3
Getting started

lint/java-config

Checkstyle or Error Prone is configured

Severitywarning
Tiersall
Stacksjava
Scopeeach
Kindexpr
Sourcelibrary v0.0.0-20261011205826-ecb4e9b3ffd4
Selected byfleetlint-recommended@0.1.0

Requirement

A static analysis beyond the compiler runs on every build: Checkstyle with a committed configuration (config/checkstyle/checkstyle.xml), Error Prone as a compiler plugin, or SpotBugs; failOnViolation set so findings fail the build.

Why

javac accepts swallowed exceptions, star imports and 400-line methods; the analyzer is where they are refused.

Check

exists("config/checkstyle/*.xml") || file("checkstyle.xml") || grep("pom.xml", "maven-checkstyle-plugin|error_prone|errorprone|spotbugs-maven-plugin").size() > 0

Fix

Add config/checkstyle/checkstyle.xml (fleetlint fix --apply writes one) and the maven-checkstyle-plugin with failOnViolation to pom.xml.

Agent instruction: Add config/checkstyle/checkstyle.xml from the template and wire maven-checkstyle-plugin in pom.xml with configLocation and failOnViolation true; fix what it reports.

fleetlint fix can apply this rule’s fix automatically (1 action(s)).

See: https://fleetlint.org/stacks/#java


Generated by fleetlint docs from catalog v0.0.0-20261011205826-ecb4e9b3ffd4.