Code Style
Formatting is enforced by Spotless using Google Java Format in AOSP profile. SpotBugs is available for static analysis but is opt-in, not wired into CI.
Spotless
Section titled “Spotless”Runs automatically on mvn verify. If the build fails on a formatting
check, apply the fix locally:
mvn spotless:applyThe AOSP profile uses 4-space indentation and a 100-column limit. Wildcard imports are banned; IntelliJ users should set the “Class count to use import with *” and “Names count to use static import with *” to something unreachable (e.g., 999).
SpotBugs (opt-in)
Section titled “SpotBugs (opt-in)”Not part of verify. Run manually:
mvn spotbugs:checkThe exclusion filter lives in spotbugs-exclude.xml. Current baseline:
zero findings.
Conventions we care about
Section titled “Conventions we care about”- No comments that narrate the code. Comments explain non-obvious intent, trade-offs, or constraints — not what a line does.
- Records for DTOs where possible.
ContentExportDtois a record; entities stay as Lombok@Dataclasses. - Lombok for boilerplate.
@Data,@Builder,@RequiredArgsConstructorare the three we use most. - Reactive where it helps. Controllers return
Mono<ResponseEntity<T>>when the call chain is non-trivial; otherwise plainResponseEntity<T>is fine. - No
${...}in MyBatis for user input. Only whitelistedsortByandorderparameters use string interpolation, and the controller validates them before passing in.