Skip to content

Commit fa795cf

Browse files
author
Jim Verheijde
committed
Bump checkstyle to 10.21.1 and CodeNarc to 3.5.0
- Bump the checkstyle dependency from 8.1 to the latest version 10.21.1 - This is needed in particular for Java 21 support, see releasenotes: https://checkstyle.sourceforge.io/releasenotes.html#Release_10.18.0 - We need to bump to JDK 11 since the new version of checkstyle requires it: checkstyle/checkstyle#9146. - Migrate checkstyle xml to remove deprecated properties and add new modules, see: - checkstyle/checkstyle#7096 - checkstyle/checkstyle#6703 - Made TestFile.java public to trigger the missing javadoc warnings. - Bump CodeNarc from 1.4 to 3.5.0 due to class loading issues on JDK 11. - This means we also need to bump groovy to 3.0.9.
1 parent 17d84ff commit fa795cf

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

build.gradle

+5-6
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ configurations {
3737

3838
project.version = findProperty("version") ?: scmVersion.version
3939

40-
sourceCompatibility = 1.8
41-
targetCompatibility = 1.8
40+
sourceCompatibility = 11
41+
targetCompatibility = 11
4242
group = 'pl.touk'
4343
mainClassName = 'pl.touk.sputnik.Main'
4444

@@ -79,7 +79,7 @@ dependencies {
7979
implementation 'com.urswolfer.gerrit.client.rest:gerrit-rest-java-client:0.9.3'
8080

8181
// Checkstyle dependencies
82-
implementation('com.puppycrawl.tools:checkstyle:8.1') {
82+
implementation('com.puppycrawl.tools:checkstyle:10.21.1') {
8383
exclude group: 'com.google.guava'
8484
}
8585

@@ -110,12 +110,11 @@ dependencies {
110110
implementation 'org.scalastyle:scalastyle_2.10:0.4.0'
111111

112112
// CodeNarc http://codenarc.sourceforge.net/
113-
implementation('org.codenarc:CodeNarc:1.4') {
113+
implementation('org.codenarc:CodeNarc:3.5.0') {
114114
exclude module: 'groovy'
115115
exclude group: 'junit'
116116
}
117-
118-
implementation 'org.codehaus.groovy:groovy:2.3.4'
117+
implementation 'org.codehaus.groovy:groovy:3.0.9' // 3.0.9 in CodeNarc
119118

120119
// JSLint
121120
implementation 'com.googlecode.jslint4java:jslint4java:2.0.5'

src/test/resources/checkstyle/checkstyle-with-suppressions.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
<module name="TreeWalker">
1313
<!-- Javadoc Comments -->
1414
<module name="AtclauseOrder"/>
15-
<module name="JavadocMethod">
16-
<property name="allowUndeclaredRTE" value="true"/>
17-
<property name="allowThrowsTagsForSubclasses" value="true"/>
15+
<module name="JavadocMethod"/>
16+
<module name="MissingJavadocMethod">
1817
<property name="allowMissingPropertyJavadoc" value="true"/>
1918
</module>
2019
<module name="JavadocParagraph"/>
@@ -27,6 +26,7 @@
2726
<!-- avoid errors on tag '@noinspection' -->
2827
<property name="allowUnknownTags" value="true"/>
2928
</module>
29+
<module name="MissingJavadocType"/>
3030
<module name="JavadocVariable"/>
3131
<module name="NonEmptyAtclauseDescription"/>
3232
<module name="SingleLineJavadoc"/>

src/test/resources/checkstyle/checkstyle.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
<module name="TreeWalker">
1010
<!-- Javadoc Comments -->
1111
<module name="AtclauseOrder"/>
12-
<module name="JavadocMethod">
13-
<property name="allowUndeclaredRTE" value="true"/>
14-
<property name="allowThrowsTagsForSubclasses" value="true"/>
12+
<module name="JavadocMethod"/>
13+
<module name="MissingJavadocMethod">
1514
<property name="allowMissingPropertyJavadoc" value="true"/>
1615
</module>
1716
<module name="JavadocParagraph"/>
@@ -24,6 +23,7 @@
2423
<!-- avoid errors on tag '@noinspection' -->
2524
<property name="allowUnknownTags" value="true"/>
2625
</module>
26+
<module name="MissingJavadocType"/>
2727
<module name="JavadocVariable"/>
2828
<module name="NonEmptyAtclauseDescription"/>
2929
<module name="SingleLineJavadoc"/>

src/test/resources/java/TestFile.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class TestFile {
1+
public class TestFile {
22
public String foo() {
33
return "bar";
44
}

0 commit comments

Comments
 (0)