--- { "title": "Java Format Code", "language": "en" } --- # 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 third party package standard java package ``` * 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/check/checkstyle/checkstyle.xml` file. The automatic formatting function of `IDEA` is also recommended. Go to `Preferences->Editor->Code Style->Java` click the config sign and select `Import Scheme`,select `IntelliJ IDEA code style XML`,and select the `build-support/IntelliJ-code-format.xml` file. If you use VS Code to develop Java code, please install `Checkstyle for Java` plugin, and config according to the [document](https://code.visualstudio.com/docs/java/java-linting) and the picture.