Skip to content

Commit

Permalink
Sort rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Mar 21, 2024
1 parent c0d98c7 commit e861551
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 68 deletions.
66 changes: 33 additions & 33 deletions etc/pmd-java-configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,67 +7,67 @@
<description>Ullrich Hafner's PMD rules</description>

<rule ref="category/java/bestpractices.xml">
<exclude name="LiteralsFirstInComparisons"/>
<exclude name="JUnitTestContainsTooManyAsserts"/>
<exclude name="JUnitTestsShouldIncludeAssert"/>
<exclude name="JUnitAssertionsShouldIncludeMessage"/>
<exclude name="GuardLogStatement"/>
<exclude name="AccessorMethodGeneration"/>
<exclude name="JUnit5TestShouldBePackagePrivate"/>
<exclude name="GuardLogStatement"/>
<exclude name="JUnit4TestShouldUseTestAnnotation"/>
<exclude name="JUnit5TestShouldBePackagePrivate"/>
<exclude name="JUnitAssertionsShouldIncludeMessage"/>
<exclude name="JUnitTestContainsTooManyAsserts"/>
<exclude name="JUnitTestsShouldIncludeAssert"/>
<exclude name="LiteralsFirstInComparisons"/>
<exclude name="UnusedPrivateMethod"/>
</rule>
<rule ref="category/java/codestyle.xml">
<exclude name="EmptyControlStatement"/>
<exclude name="AtLeastOneConstructor"/>
<exclude name="UnnecessaryConstructor"/>
<exclude name="FieldDeclarationsShouldBeAtStartOfClass"/>
<exclude name="ClassNamingConventions"/>
<exclude name="CommentDefaultAccessModifier"/>
<exclude name="ConfusingTernary"/>
<exclude name="EmptyControlStatement"/>
<exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/>
<exclude name="FieldDeclarationsShouldBeAtStartOfClass"/>
<exclude name="LocalVariableCouldBeFinal"/>
<exclude name="LocalVariableNamingConventions"/>
<exclude name="LongVariable"/>
<exclude name="ShortVariable"/>
<exclude name="ShortClassName"/>
<exclude name="OnlyOneReturn"/>
<exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/>
<exclude name="ConfusingTernary"/>
<exclude name="LocalVariableNamingConventions"/>
<exclude name="ClassNamingConventions"/>
</rule>
<rule ref="category/java/codestyle.xml/UnnecessaryConstructor">
<properties>
<property name="ignoredAnnotations" value="org.kohsuke.stapler.DataBoundConstructor"/>
</properties>
<exclude name="ShortClassName"/>
<exclude name="ShortVariable"/>
<exclude name="UnnecessaryConstructor"/>
</rule>
<rule ref="category/java/codestyle.xml/ClassNamingConventions">
<properties>
<property name="utilityClassPattern" value="[A-Z][a-zA-Z0-9]+"/>
<property name="testClassPattern" value="^[A-Z][a-zA-Z0-9]+Test.*$|^[A-Z][a-zA-Z0-9]+Benchmark.*$|"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/ConfusingTernary">
<properties>
<property name="ignoreElseIf" value="true"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/LinguisticNaming">
<properties>
<property name="checkSetters" value="false"/>
<property name="booleanMethodPrefixes" value="is|has|can|have|will" />
</properties>
</rule>
<rule ref="category/java/codestyle.xml/ConfusingTernary">
<rule ref="category/java/codestyle.xml/UnnecessaryConstructor">
<properties>
<property name="ignoreElseIf" value="true"/>
<property name="ignoredAnnotations" value="org.kohsuke.stapler.DataBoundConstructor"/>
</properties>
</rule>
<rule ref="category/java/design.xml">
<exclude name="LoosePackageCoupling"/>
<exclude name="LawOfDemeter"/>
<exclude name="TooManyMethods"/>
<exclude name="ClassWithOnlyPrivateConstructorsShouldBeFinal"/>
<exclude name="ExcessiveParameterList"/>
<exclude name="ExcessiveMethodLength"/>
<exclude name="UseObjectForClearerAPI"/>
<exclude name="AvoidCatchingGenericException"/>
<exclude name="FinalFieldCouldBeStatic"/>
<exclude name="AvoidUncheckedExceptionsInSignatures"/>
<exclude name="ClassWithOnlyPrivateConstructorsShouldBeFinal"/>
<exclude name="ExcessiveImports"/>
<exclude name="ExcessiveMethodLength"/>
<exclude name="ExcessiveParameterList"/>
<exclude name="FinalFieldCouldBeStatic"/>
<exclude name="LawOfDemeter"/>
<exclude name="LoosePackageCoupling"/>
<exclude name="SimplifyBooleanReturns"/>
<exclude name="TooManyMethods"/>
<exclude name="UseObjectForClearerAPI"/>
</rule>
<rule ref="category/java/design.xml/SimplifyBooleanReturns">
<properties>
Expand All @@ -76,9 +76,9 @@
</rule>
<rule ref="category/java/errorprone.xml">
<exclude name="AvoidDuplicateLiterals"/>
<exclude name="TestClassWithoutTestCases"/>
<exclude name="EmptyCatchBlock"/>
<exclude name="AvoidLiteralsInIfCondition"/>
<exclude name="EmptyCatchBlock"/>
<exclude name="TestClassWithoutTestCases"/>
<exclude name="UseProperClassLoader"/>
</rule>
<rule ref="category/java/errorprone.xml/AvoidLiteralsInIfCondition">
Expand All @@ -97,8 +97,8 @@
<rule ref="category/java/performance.xml">
<exclude name="AppendCharacterWithChar"/>
<exclude name="AvoidInstantiatingObjectsInLoops"/>
<exclude name="RedundantFieldInitializer"/>
<exclude name="ConsecutiveAppendsShouldReuse"/>
<exclude name="RedundantFieldInitializer"/>
<exclude name="UseStringBufferForStringAppends"/>
</rule>
<rule ref="category/java/security.xml">
Expand Down
69 changes: 34 additions & 35 deletions etc/pmd-tests-configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,69 +7,68 @@
<description>Ullrich Hafner's PMD rules</description>

<rule ref="category/java/bestpractices.xml">
<exclude name="LiteralsFirstInComparisons"/>
<exclude name="JUnitTestContainsTooManyAsserts"/>
<exclude name="JUnitTestsShouldIncludeAssert"/>
<exclude name="JUnitAssertionsShouldIncludeMessage"/>
<exclude name="GuardLogStatement"/>
<exclude name="AccessorMethodGeneration"/>
<exclude name="JUnit5TestShouldBePackagePrivate"/>
<exclude name="GuardLogStatement"/>
<exclude name="JUnit4TestShouldUseTestAnnotation"/>
<exclude name="JUnit5TestShouldBePackagePrivate"/>
<exclude name="JUnitAssertionsShouldIncludeMessage"/>
<exclude name="JUnitTestContainsTooManyAsserts"/>
<exclude name="JUnitTestsShouldIncludeAssert"/>
<exclude name="LiteralsFirstInComparisons"/>
<exclude name="UnusedPrivateMethod"/>
<exclude name="LooseCoupling"/>
</rule>
<rule ref="category/java/codestyle.xml">
<exclude name="EmptyControlStatement"/>
<exclude name="AtLeastOneConstructor"/>
<exclude name="UnnecessaryConstructor"/>
<exclude name="FieldDeclarationsShouldBeAtStartOfClass"/>
<exclude name="ClassNamingConventions"/>
<exclude name="CommentDefaultAccessModifier"/>
<exclude name="ConfusingTernary"/>
<exclude name="EmptyControlStatement"/>
<exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/>
<exclude name="FieldDeclarationsShouldBeAtStartOfClass"/>
<exclude name="LocalVariableCouldBeFinal"/>
<exclude name="LocalVariableNamingConventions"/>
<exclude name="LongVariable"/>
<exclude name="ShortVariable"/>
<exclude name="ShortClassName"/>
<exclude name="OnlyOneReturn"/>
<exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/>
<exclude name="ConfusingTernary"/>
<exclude name="LocalVariableNamingConventions"/>
<exclude name="ClassNamingConventions"/>
</rule>
<rule ref="category/java/codestyle.xml/UnnecessaryConstructor">
<properties>
<property name="ignoredAnnotations" value="org.kohsuke.stapler.DataBoundConstructor"/>
</properties>
<exclude name="ShortClassName"/>
<exclude name="ShortVariable"/>
<exclude name="UnnecessaryConstructor"/>
</rule>
<rule ref="category/java/codestyle.xml/ClassNamingConventions">
<properties>
<property name="utilityClassPattern" value="[A-Z][a-zA-Z0-9]+"/>
<property name="testClassPattern" value="^[A-Z][a-zA-Z0-9]+Test.*$|^[A-Z][a-zA-Z0-9]+Benchmark.*$|"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/ConfusingTernary">
<properties>
<property name="ignoreElseIf" value="true"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/LinguisticNaming">
<properties>
<property name="checkSetters" value="false"/>
<property name="booleanMethodPrefixes" value="is|has|can|have|will" />
</properties>
</rule>
<rule ref="category/java/codestyle.xml/ConfusingTernary">
<rule ref="category/java/codestyle.xml/UnnecessaryConstructor">
<properties>
<property name="ignoreElseIf" value="true"/>
<property name="ignoredAnnotations" value="org.kohsuke.stapler.DataBoundConstructor"/>
</properties>
</rule>
<rule ref="category/java/design.xml">
<exclude name="LoosePackageCoupling"/>
<exclude name="LawOfDemeter"/>
<exclude name="TooManyMethods"/>
<exclude name="ClassWithOnlyPrivateConstructorsShouldBeFinal"/>
<exclude name="ExcessiveParameterList"/>
<exclude name="ExcessiveMethodLength"/>
<exclude name="UseObjectForClearerAPI"/>
<exclude name="AvoidCatchingGenericException"/>
<exclude name="FinalFieldCouldBeStatic"/>
<exclude name="AvoidUncheckedExceptionsInSignatures"/>
<exclude name="ClassWithOnlyPrivateConstructorsShouldBeFinal"/>
<exclude name="ExcessiveImports"/>
<exclude name="ExcessiveMethodLength"/>
<exclude name="ExcessiveParameterList"/>
<exclude name="FinalFieldCouldBeStatic"/>
<exclude name="LawOfDemeter"/>
<exclude name="LoosePackageCoupling"/>
<exclude name="SignatureDeclareThrowsException"/>
<exclude name="SimplifyBooleanReturns"/>
<exclude name="DataClass"/>
<exclude name="TooManyMethods"/>
<exclude name="UseObjectForClearerAPI"/>
</rule>
<rule ref="category/java/design.xml/SimplifyBooleanReturns">
<properties>
Expand All @@ -78,9 +77,9 @@
</rule>
<rule ref="category/java/errorprone.xml">
<exclude name="AvoidDuplicateLiterals"/>
<exclude name="TestClassWithoutTestCases"/>
<exclude name="EmptyCatchBlock"/>
<exclude name="AvoidLiteralsInIfCondition"/>
<exclude name="EmptyCatchBlock"/>
<exclude name="TestClassWithoutTestCases"/>
<exclude name="UseProperClassLoader"/>
</rule>
<rule ref="category/java/errorprone.xml/AvoidLiteralsInIfCondition">
Expand All @@ -99,8 +98,8 @@
<rule ref="category/java/performance.xml">
<exclude name="AppendCharacterWithChar"/>
<exclude name="AvoidInstantiatingObjectsInLoops"/>
<exclude name="RedundantFieldInitializer"/>
<exclude name="ConsecutiveAppendsShouldReuse"/>
<exclude name="RedundantFieldInitializer"/>
<exclude name="UseStringBufferForStringAppends"/>
</rule>
<rule ref="category/java/security.xml">
Expand Down

0 comments on commit e861551

Please sign in to comment.