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

PMD 7 changes #14

Merged
merged 1 commit into from
Jan 29, 2024
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
otj-pmd-rulesets changelog
==========================
7.0.0
-----
* For PMD 7 compataibility - should NOT be used with PMD < 7
1.2.8
-----
* Customize AvoidDuplicateLiterals to be less annoying
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<groupId>com.opentable</groupId>
<artifactId>otj-pmd-rulesets</artifactId>
<name>otj-pmd-rulesets</name>
<version>1.2.11-SNAPSHOT</version>
<version>7.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<description>OpenTable PMD rulesets</description>
</project>
18 changes: 5 additions & 13 deletions src/main/resources/otj-pmd-rulesets/ot-pmd.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
<exclude name="ForLoopCanBeForeach" />
</rule>
<rule ref="category/java/codestyle.xml">
<!-- too many fp -->
<exclude name="UnnecessaryBoxing" />
<exclude name="ConfusingTernary" />
<exclude name="FieldDeclarationsShouldBeAtStartOfClass" />
<exclude name="EmptyMethodInAbstractClassShouldBeAbstract" />
Expand All @@ -49,26 +51,22 @@
<exclude name="MethodArgumentCouldBeFinal" />
<!-- same.. -->
<exclude name="LocalVariableCouldBeFinal" />
<!-- ha! -->
<exclude name="AvoidFinalLocalVariable" />
<!-- spiritual agreement, but -->
<exclude name="ShortVariable" />
<!-- yeah, right require comments for every default acccess method, class, constructor. That's sane -->
<exclude name="CommentDefaultAccessModifier" />
<!-- I agree, but ... -->
<exclude name="BooleanGetMethodName" />
<exclude name="UseDiamondOperator" />
<exclude name="LongVariable" />
<exclude name="OnlyOneReturn" />
<exclude name="DefaultPackage" />
<exclude name="VariableNamingConventions" />
<exclude name="ClassNamingConventions" />
<!-- aka boilerplate -->
<exclude name="CallSuperInConstructor" />
<!-- nice idea, bad idea -->
<exclude name="PrematureDeclaration" />
<exclude name="ShortMethodName" />
<exclude name="MethodNamingConventions" />
<exclude name="AvoidPrefixingMethodParameters" />
<exclude name="ShortClassName" />
<exclude name="GenericsNaming" />
<!-- Way too picky @Goofy("star") vs @Goofy(value = "star") is ok -->
Expand All @@ -84,6 +82,7 @@
<exclude name="UnnecessarySemicolon"/>
</rule>
<rule ref="category/java/design.xml">
<exclude name="ClassWithOnlyPrivateConstructorsShouldBeFinal" />
<exclude name="AvoidDeeplyNestedIfStmts" />
<exclude name="GodClass" />
<!-- Though please don't -->
Expand Down Expand Up @@ -124,7 +123,6 @@
</rule>
<rule ref="category/java/errorprone.xml/AvoidDuplicateLiterals">
<properties>
<property name="separator" value="," />
<property name="maxDuplicateLiterals" value="8" />
<property name="minimumLength" value="3" />
<property name="skipAnnotations" value="true" />
Expand All @@ -135,9 +133,7 @@
<exclude name="ReturnEmptyCollectionRatherThanNull" />
<exclude name="NonSerializableClass"/>
<exclude name="TestClassWithoutTestCases"/>
<exclude name="CompareObjectsWithEquals" />
<!-- Added these too -->
<exclude name="DataflowAnomalyAnalysis" />
<exclude name="CompareObjectsWithEquals" />
<!-- no. just no. This should be discussed in PRs not by PMD -->
<exclude name="AvoidLiteralsInIfCondition" />
<!-- On the border here, but ... -->
Expand Down Expand Up @@ -167,10 +163,6 @@
<!-- obviously true, but triggers for a single concatenation which is unreasonable -->
<exclude name="UseStringBufferForStringAppends" />
<exclude name="AvoidFileStream" />
<!-- too many fp -->
<exclude name="UnnecessaryWrapperObjectCreation" />
<!-- A reasonable rule, except leads to frustrating breakage - you also have to check if string is not blank -->
<exclude name="SimplifyStartsWith" />
</rule>
<rule ref="category/java/security.xml" />

Expand Down