| name | fe-code-style |
| description | Fix FE (Java) code style issues using Checkstyle |
| compatibility | opencode |
What I do
Diagnose and fix Java code style issues in the FE module using the project's Checkstyle configuration.
When to use me
- Before committing FE Java code changes
- When FE build fails due to checkstyle violations
- When you need to understand FE style rules
Procedure
Step 1: Run checkstyle
Checkstyle is integrated into the Maven build and runs automatically during mvn validate. To check style only (without full compilation):
cd fe && mvn checkstyle:check -pl fe-core
Or as part of the normal build:
./build.sh --fe -j${DORIS_PARALLELISM}
If checkstyle fails, the build will fail with error messages showing the file, line number, and rule violated.
Step 2: Interpret violations
Checkstyle output looks like:
[ERROR] src/main/java/.../Foo.java:[42:5] (imports) UnusedImports: Unused import - java.util.List.
[ERROR] src/main/java/.../Bar.java:[10] (header) RegexpHeader: Line does not match expected header line...
Each error shows: [file]:[line:col] (category) RuleName: description.
Step 3: Fix common violations