Skip to content
baffo32 edited this page Dec 3, 2015 · 8 revisions

In 2014, a vote was held to determine what the general preference was regarding the code format of XChange. After determining what code format to go with the second challenge was to create compatible code formatting profiles for the different IDEs.

The resulting formatting profiles for the different IDEs can be found in xchange-parent/etc.

If you would like to contribute a format profile for an IDE not yet available, it would be greatly appreciated. If you find any inconsistencies, please either mention them in the above referenced issue or submit a patch to the formatting profile directly.

The main code formatting aspects are as follows:

Style Value
Indentation 2 spaces
Max empty lines 1
Line after method declaration minimum of zero
import ordering static, java, javax, org, com, other
import spacing spaces between import groups
line length 150 columns
line breaks Unix (\n)
Continuation indent 4

Instructions

IntelliJ IDEA

Copy the file XChange_Idea_2014_12.xml to the config/codestyles subfolder of your Idea home directory. Restart Idea, and set this scheme in File -> Settings -> Editor -> Code Style.