Skip to content

Commit

Permalink
Merge pull request #38 from BetonQuest/ITTests
Browse files Browse the repository at this point in the history
added IT tests to pmd rule set and AvoidDuplicateLiterals now ignores…
  • Loading branch information
Wolf2323 authored Jan 6, 2025
2 parents 48d17d5 + 5a04f6a commit e657dc6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 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
2 changes: 1 addition & 1 deletion configs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<properties>
<!-- project version -->
<revision>1.2.0</revision>
<revision>1.3.0</revision>
<changelist>-SNAPSHOT</changelist>
</properties>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<properties>
<!-- project version -->
<revision>1.2.0</revision>
<revision>1.3.0</revision>
<changelist>-SNAPSHOT</changelist>
<!-- project properties -->
<skipShade>false</skipShade>
Expand Down
2 changes: 1 addition & 1 deletion versions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<properties>
<!-- project version -->
<revision>1.2.0</revision>
<revision>1.3.0</revision>
<changelist>-SNAPSHOT</changelist>
<!-- project settings -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down

0 comments on commit e657dc6

Please sign in to comment.