Java

In this tutorial you will learn how to change the current code style to the one supported by Parabot.

Downloading the settings

You will have to download the style settings from our github.

You will have will have a page containing this code:

<code_scheme name="Parabot">
  <option name="LINE_SEPARATOR" value="&#xA;" />
  <option name="JD_ADD_BLANK_AFTER_PARM_COMMENTS" value="true" />
  <option name="JD_ADD_BLANK_AFTER_RETURN" value="true" />
  <codeStyleSettings language="JAVA">
    <option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
    <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
    <option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
    <option name="ALIGN_GROUP_FIELD_DECLARATIONS" value="true" />
    <option name="ALIGN_CONSECUTIVE_VARIABLE_DECLARATIONS" value="true" />
    <option name="SPACE_WITHIN_ARRAY_INITIALIZER_BRACES" value="true" />
    <option name="IF_BRACE_FORCE" value="3" />
    <option name="DOWHILE_BRACE_FORCE" value="3" />
    <option name="WHILE_BRACE_FORCE" value="3" />
    <option name="FOR_BRACE_FORCE" value="3" />
  </codeStyleSettings>
</code_scheme>


Then right click and save as Format.xml

Activating the style

To activate the code style it's pretty easy.

Go into your IntelliJ and go into File→Settings→Editor→Code Style for Windows and Linux or IntelliJ IDEA→Preferences→Editor→Code Style for OS X.


From here you will click on the little gear on the right of Scheme and you will click on Import scheme→IntelliJ IDEA code style XML.

And you will select the format that you downloaded previously.

Aall you have to do now is press Ok.

The code style will automatically change the Parabot's one.

All you will have to do next is reformat the code!


Make sure when you make a commit to Parabot's code to use this code style!