Skip to content

Commit

Permalink
This commits forces each java construct to wrap if it is longer than 120
Browse files Browse the repository at this point in the history
chars. Also it intends the same logical constructs on top of each other,
example:

myAwesomeBuilder.verrrryyyyLoooonnnnggggFoooooooooo1()
                .verrrryyyyLoooonnnnggggFoooooooooo2()
                .verrrryyyyLoooonnnnggggFoooooooooo3()

or during the method call:

myAwesomeMethod(verrrryyyyLoooonnnnggggFooooooooo1,
                verrrryyyyLoooonnnnggggFooooooooo2,
                verrrryyyyLoooonnnnggggFooooooooo3)

on the other hand, there are some corner cases where the combination of
the rules produces kind of strange looking lines like:

assertEquals("User should have no roles on resource", 0, personaService.getEffectiveRolesForResource(user,
                                                                                                     resource)
                                                                       .size());

I.e. the method parameters are under each other and the chained method calls as
well. I found this more readable, even though strange looking at the
first sight.

All in all, it passes the checkstyle and we can improve on it.
  • Loading branch information
jkremser committed Aug 5, 2015
1 parent 82cd5cc commit b061c0a
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions ide-configs/idea/config/codestyles/Hawkular.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,40 @@
</option>
<option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="true" />
<JavaCodeStyleSettings>
<option name="ANNOTATION_PARAMETER_WRAP" value="1" />
<option name="ALIGN_MULTILINE_ANNOTATION_PARAMETERS" value="true" />
</JavaCodeStyleSettings>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
<codeStyleSettings language="JAVA">
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
<option name="ALIGN_MULTILINE_CHAINED_METHODS" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_METHOD_BRACKETS" value="true" />
<option name="ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="RESOURCE_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="ASSERT_STATEMENT_WRAP" value="1" />
<option name="METHOD_ANNOTATION_WRAP" value="1" />
<option name="CLASS_ANNOTATION_WRAP" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="1" />
<option name="PARAMETER_ANNOTATION_WRAP" value="1" />
<option name="VARIABLE_ANNOTATION_WRAP" value="1" />
<option name="ENUM_CONSTANTS_WRAP" value="1" />
</codeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
Expand Down

0 comments on commit b061c0a

Please sign in to comment.