Java Format Code
The formatting of the Java part of the code in Doris is usually done automatically by the IDE. Only the general format rules are listed here. For developer, you need to set the corresponding code styles in different IDEs according to the format rules.
Import Order
org.apache.doris
<blank line>
com
<blank line>
org
<blank line>
java
<blank line>
javax
<blank line>
- Do not use
import *
- Do not use
import static
Checkstyle
Now we have formatter-check
in CI
to check the code format.
If you use IDEA
to develop Java code, please install Checkstyle-IDEA
plugin.
Setting the checkstyle.xml
file in Tools->Checkstyle
.
Click the plus sign under Configuration File, Select Use a local Checkstyle file
, and select the fe/checkstyle.xml
file.
If you use VS Code to develop Java code, please install Checkstyle for Java
plugin, and config according to the document (opens new window) and the picture.