Skip to content

Commit

Permalink
update pmd and checktyle;
Browse files Browse the repository at this point in the history
disable deprecated rules in pmd config;
disable UnnecessaryParentheses in checkstyle config due to false positives
  • Loading branch information
xvik committed Apr 26, 2021
1 parent 43aa385 commit 7191214
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
* Fix gradle 7 compatibility (for checkstyle plugin)
* Update checkstyle 8.39 -> 8.41.1
* Update checkstyle 8.39 -> 8.42
* Update checkstyle config:
- Add [RecordComponentName](https://checkstyle.sourceforge.io/config_naming.html#RecordComponentName)
- Disable [Indentation](http://checkstyle.sourceforge.io/config_misc.html#Indentation) as causing problems too often
(currently in regression since 8.40)
* Update pmd 6.31 -> 6.33 (java 16 support)
- Disable [UnnecessaryParentheses](https://checkstyle.sourceforge.io/config_coding.html#UnnecessaryParentheses) due
to often false complains in if statements (especially many misses in 8.42)
* Update pmd 6.31 -> 6.34 (java 16 support)
* Update pmd config:
- Disable deprecated [UnusedImports](https://pmd.github.io/pmd-6.34.0/pmd_rules_java_bestpractices.html#unusedimports),
[DuplicateImports](https://pmd.github.io/pmd-6.34.0/pmd_rules_java_codestyle.html#duplicateimports),
[ImportFromSamePackage](https://pmd.github.io/pmd-6.34.0/pmd_rules_java_errorprone.html#importfromsamepackage),
[DontImportJavaLang](https://pmd.github.io/pmd-6.34.0/pmd_rules_java_codestyle.html#dontimportjavalang)
(replaced by new UnnecessaryImport rule)
* Update spotbugs 4.2.1 -> 4.2.3
* Update spotbugs plugin 4.6.0 -> 4.7.0
* Update codenarc 2.0.0 -> 2.1.0
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ mkdocs {
}
extras = [
'version': project.docVersion,
'checkstyle': '8.41.1',
'pmd': '6.33.0',
'checkstyle': '8.42',
'pmd': '6.34.0',
'spotbugs': '4.2.3',
'codenarc': '2.1.0',
'spotbugsPlugin': project.spotbugsPluginVersion,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class QualityExtension {
sourceSets = [project.sourceSets.main] as Collection<SourceSet>
}

String checkstyleVersion = '8.41.1'
String pmdVersion = '6.33.0'
String checkstyleVersion = '8.42'
String pmdVersion = '6.34.0'
String spotbugsVersion = '4.2.3'
String codenarcVersion = '2.1.0'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<module name="StringLiteralEquality"/>
<!--<module name="SuperClone"/>-->
<!--<module name="SuperFinalize"/>-->
<module name="UnnecessaryParentheses"/>
<!--<module name="UnnecessaryParentheses"/>--> <!-- disabled due to often false complains inside if -->
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/>
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
<module name="UnnecessarySemicolonInEnumeration"/>
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/ru/vyarus/quality/config/pmd/pmd.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<exclude name="JUnit4TestShouldUseBeforeAnnotation"/>
<exclude name="JUnit4TestShouldUseAfterAnnotation"/>
<exclude name="JUnit4TestShouldUseTestAnnotation"/>
<exclude name="UnusedImports"/> <!-- deprecated in favour of UnnecessaryImport -->
</rule>


Expand All @@ -33,6 +34,8 @@
<exclude name="CommentDefaultAccessModifier"/>
<exclude name="ConfusingTernary"/>
<exclude name="ClassNamingConventions"/>
<exclude name="DontImportJavaLang"/> <!-- deprecated in favour of UnnecessaryImport -->
<exclude name="DuplicateImports"/> <!-- deprecated in favour of UnnecessaryImport -->
<exclude name="LocalHomeNamingConvention"/> <!-- earlier j2ee group-->
<exclude name="LocalInterfaceSessionNamingConvention"/> <!-- earlier j2ee group-->
<exclude name="LocalVariableCouldBeFinal"/>
Expand Down Expand Up @@ -116,6 +119,7 @@
<exclude name="FinalizeDoesNotCallSuperFinalize"/>
<exclude name="JUnitSpelling"/>
<exclude name="JUnitStaticSuite"/>
<exclude name="ImportFromSamePackage"/> <!-- deprecated in favour of UnnecessaryImport -->
<exclude name="InvalidLogMessageFormat"/>
<exclude name="LoggerIsNotStaticFinal"/>
<exclude name="MissingSerialVersionUID"/>
Expand Down

0 comments on commit 7191214

Please sign in to comment.