ruleset: fix order of properties and adjust indentation

This commit is contained in:
Paul Campbell 2018-08-26 15:49:02 +01:00
parent f5665a0733
commit ee7eb75ffb
6 changed files with 107 additions and 105 deletions

View file

@ -27,6 +27,7 @@ import lombok.Setter;
import net.kemitix.conditional.Value; import net.kemitix.conditional.Value;
import java.net.URI; import java.net.URI;
import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
@ -133,6 +134,7 @@ public class Rule {
private static String formatProperties(final Map<String, String> properties) { private static String formatProperties(final Map<String, String> properties) {
return MapStream.of(properties) return MapStream.of(properties)
.sorted(Comparator.comparing(Map.Entry::getKey))
.map((k, v) -> String.format(" <property name=\"%s\" value=\"%s\"/>", k, v)) .map((k, v) -> String.format(" <property name=\"%s\" value=\"%s\"/>", k, v))
.collect(Collectors.joining(System.lineSeparator())); .collect(Collectors.joining(System.lineSeparator()));
} }

View file

@ -35,8 +35,8 @@
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck"> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck">
<property name="tokens" value="DOT"/>
<property name="allowLineBreaks" value="false"/> <property name="allowLineBreaks" value="false"/>
<property name="tokens" value="DOT"/>
</module> </module>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck"/>
@ -45,8 +45,8 @@
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck"> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck">
<property name="tokens" value="DOT"/>
<property name="option" value="nl"/> <property name="option" value="nl"/>
<property name="tokens" value="DOT"/>
</module> </module>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck"/>

View file

@ -52,8 +52,8 @@
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck"> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck">
<property name="tokens" value="DOT"/>
<property name="allowLineBreaks" value="false"/> <property name="allowLineBreaks" value="false"/>
<property name="tokens" value="DOT"/>
</module> </module>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck"/>
@ -66,8 +66,8 @@
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck"> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck">
<property name="tokens" value="DOT"/>
<property name="option" value="nl"/> <property name="option" value="nl"/>
<property name="tokens" value="DOT"/>
</module> </module>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck"/>

View file

@ -44,8 +44,8 @@
<module name="com.puppycrawl.tools.checkstyle.checks.naming.InterfaceTypeParameterNameCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.naming.InterfaceTypeParameterNameCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck">
<property name="allowMissingPropertyJavadoc" value="true"/> <property name="allowMissingPropertyJavadoc" value="true"/>
<property name="validateThrows" value="true"/>
<property name="scope" value="package"/> <property name="scope" value="package"/>
<property name="validateThrows" value="true"/>
</module> </module>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/>
@ -69,8 +69,8 @@
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.NonEmptyAtclauseDescriptionCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.NonEmptyAtclauseDescriptionCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck"> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck">
<property name="tokens" value="DOT"/>
<property name="allowLineBreaks" value="false"/> <property name="allowLineBreaks" value="false"/>
<property name="tokens" value="DOT"/>
</module> </module>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck"/>
@ -84,8 +84,8 @@
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck"> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck">
<property name="tokens" value="DOT"/>
<property name="option" value="nl"/> <property name="option" value="nl"/>
<property name="tokens" value="DOT"/>
</module> </module>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck"/>

View file

@ -71,8 +71,8 @@
<module name="com.puppycrawl.tools.checkstyle.checks.naming.InterfaceTypeParameterNameCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.naming.InterfaceTypeParameterNameCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck">
<property name="allowMissingPropertyJavadoc" value="true"/> <property name="allowMissingPropertyJavadoc" value="true"/>
<property name="validateThrows" value="true"/>
<property name="scope" value="package"/> <property name="scope" value="package"/>
<property name="validateThrows" value="true"/>
</module> </module>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/>
@ -103,8 +103,8 @@
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.NonEmptyAtclauseDescriptionCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.NonEmptyAtclauseDescriptionCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck"> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck">
<property name="tokens" value="DOT"/>
<property name="allowLineBreaks" value="false"/> <property name="allowLineBreaks" value="false"/>
<property name="tokens" value="DOT"/>
</module> </module>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck"/>
@ -125,8 +125,8 @@
</module> </module>
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck"> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck">
<property name="tokens" value="DOT"/>
<property name="option" value="nl"/> <property name="option" value="nl"/>
<property name="tokens" value="DOT"/>
</module> </module>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck"/>

View file

@ -91,8 +91,8 @@
<module name="com.puppycrawl.tools.checkstyle.checks.naming.InterfaceTypeParameterNameCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.naming.InterfaceTypeParameterNameCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck">
<property name="allowMissingPropertyJavadoc" value="true"/> <property name="allowMissingPropertyJavadoc" value="true"/>
<property name="validateThrows" value="true"/>
<property name="scope" value="package"/> <property name="scope" value="package"/>
<property name="validateThrows" value="true"/>
</module> </module>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/>
@ -139,8 +139,8 @@
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.NonEmptyAtclauseDescriptionCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.NonEmptyAtclauseDescriptionCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck"> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck">
<property name="tokens" value="DOT"/>
<property name="allowLineBreaks" value="false"/> <property name="allowLineBreaks" value="false"/>
<property name="tokens" value="DOT"/>
</module> </module>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.metrics.NPathComplexityCheck"> <module name="com.puppycrawl.tools.checkstyle.checks.metrics.NPathComplexityCheck">
@ -168,8 +168,8 @@
<module name="com.puppycrawl.tools.checkstyle.checks.coding.ReturnCountCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.coding.ReturnCountCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck"> <module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck">
<property name="tokens" value="DOT"/>
<property name="option" value="nl"/> <property name="option" value="nl"/>
<property name="tokens" value="DOT"/>
</module> </module>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck"/> <module name="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck"/>