Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1.75 KB

CONTRIBUTING.md

File metadata and controls

39 lines (29 loc) · 1.75 KB

IDE Config and Code Style

This project has a strictly enforced code style. Code formatting is done by the Eclipse code formatter, using the config files found in the build-tools directory. By default when you run mvn install the code will be formatted automatically. When submitting a pull request the CI build will fail if running the formatter results in any code changes, so it is recommended that you always run a full Maven build before submitting a pull request.

If you want to run the formatting without doing a full build, you can run mvn process-sources.

Eclipse Setup

Open the Preferences window, and then navigate to Java -> Code Style -> Formatter. Click _ Import_ and then select the eclipse-format.xml file in the build-tools directory.

Next navigate to Java -> Code Style -> Organize Imports. Click Import and select the eclipse.importorder file.

IDEA Setup

Open the Preferences window (or Settings depending on your edition), navigate to Plugins and install the Eclipse Code Formatter Plugin from the Marketplace.

Restart your IDE, open the Preferences (or Settings) window again and navigate to Other Settings -> Eclipse Code Formatter.

Select Use the Eclipse Code Formatter, then change the Eclipse Java Formatter Config File to point to the eclipse-format.xml file in the build-tools directory. Make sure the _ Optimize Imports_ box is ticked, and select the eclipse.importorder file as the import order config file.

Next, disable wildcard imports: navigate to Editor -> Code Style -> Java -> Imports and set Class count to use import with '*' to 999. Do the same with Names count to use static import with '*'.