Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added IT tests to pmd rule set and AvoidDuplicateLiterals now ignores… #38

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading