Skip to content

Commit

Permalink
added IT tests to pmd rule set and AvoidDuplicateLiterals now ignores…
Browse files Browse the repository at this point in the history
… annotations
  • Loading branch information
Wolf2323 committed Jan 6, 2025
1 parent 48d17d5 commit c4609bd
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions configs/pmd-ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>

<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="Custom Rules"
<ruleset name="Custom Rules"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">

Expand Down Expand Up @@ -72,8 +72,7 @@

<rule ref="category/java/codestyle.xml/AtLeastOneConstructor">
<properties>
<property name="violationSuppressXPath"
value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*(Test|Fixture)$')]"/>
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*(IT|Test|Fixture)$')]"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/AvoidDollarSigns"/>
Expand Down Expand Up @@ -126,7 +125,7 @@
<rule ref="category/java/codestyle.xml/LambdaCanBeMethodReference"/>
<rule ref="category/java/codestyle.xml/LinguisticNaming">
<properties>
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*Test$')]"/>
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*(IT|Test|Fixture)$')]"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/LocalHomeNamingConvention"/>
Expand All @@ -152,8 +151,7 @@
<rule ref="category/java/codestyle.xml/ShortVariable"/>
<rule ref="category/java/codestyle.xml/TooManyStaticImports">
<properties>
<property name="violationSuppressXPath"
value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*(Test|Fixture)$')]"/>
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*(IT|Test|Fixture)$')]"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/UnnecessaryAnnotationValueElement"/>
Expand Down Expand Up @@ -216,7 +214,7 @@
<rule ref="category/java/design.xml/TooManyFields"/>
<rule ref="category/java/design.xml/TooManyMethods">
<properties>
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*Test$')]"/>
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*(IT|Test|Fixture)$')]"/>
</properties>
</rule>
<rule ref="category/java/design.xml/UselessOverridingMethod"/>
Expand All @@ -226,8 +224,7 @@
<rule ref="category/java/documentation.xml/CommentContent"/>
<rule ref="category/java/documentation.xml/CommentRequired">
<properties>
<property name="violationSuppressXPath"
value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*(Test|Fixture)$')]"/>
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*(IT|Test|Fixture)$')]"/>
</properties>
</rule>
<rule ref="category/java/documentation.xml/CommentSize">
Expand All @@ -250,7 +247,8 @@
<rule ref="category/java/errorprone.xml/AvoidDecimalLiteralsInBigDecimalConstructor"/>
<rule ref="category/java/errorprone.xml/AvoidDuplicateLiterals">
<properties>
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*Test$')]"/>
<property name="skipAnnotations" value="true" />
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*(IT|Test|Fixture)$')]"/>
</properties>
</rule>
<rule ref="category/java/errorprone.xml/AvoidEnumAsIdentifier"/>
Expand Down

0 comments on commit c4609bd

Please sign in to comment.