Skip to content

Commit

Permalink
Upgrade Checkstyle to 10.21.1
Browse files Browse the repository at this point in the history
Upgrades Checkstyle from 10.17.0 to 10.21.1.

For release notes, see:
https://github.com/checkstyle/checkstyle/releases

Note that default behavior for checking tags in javadoc changed
in version 10.20.2, it will not longer issue a warning about
missing tags if there is no javadoc section at all.
See checkstyle/checkstyle#11584

Signed-off-by: Holger Friedrich <[email protected]>
  • Loading branch information
holgerfriedrich committed Jan 30, 2025
1 parent 51214a5 commit 17197af
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ public void testOuterClasWithNoJavaDoc() throws Exception {
* an error is expected at the line where the outer class is declared
* in the file
*/
int warningLine = 1;
// since https://github.com/checkstyle/checkstyle/issues/11584 there is no warning
// if no javadoc is present
boolean checkInnerClasses = false;
checkFileForAuthorTags(checkInnerClasses, fileName, warningLine);
checkFileForAuthorTags(checkInnerClasses, fileName);
}

@Test
Expand All @@ -77,10 +78,10 @@ public void testOuterAndInnerClassesWithNoJavaDoc() throws Exception {
* errors are expected at the lines where the classes are declared in
* the file
*/
int firstWarningLine = 1;
int secondWarningLine = 3;
// since https://github.com/checkstyle/checkstyle/issues/11584 there is no warning
// if no javadoc is present
boolean checkInnerClasses = true;
checkFileForAuthorTags(checkInnerClasses, fileName, firstWarningLine, secondWarningLine);
checkFileForAuthorTags(checkInnerClasses, fileName);
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion docs/maven-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Parameters:
| ------ | ------| -------- |
| **checkstyleRuleset** | String | Relative path of the XML configuration to use. If not set the default ruleset file will be used |
| **checkstyleFilter** | String | Relative path of the suppressions XML file to use. If not set the default filter file will be used |
| **maven.checkstyle.version** | String | The version of the maven-checkstyle-plugin that will be used (default value is **3.4.0**)|
| **maven.checkstyle.version** | String | The version of the maven-checkstyle-plugin that will be used (default value is **3.6.0**)|
| **checkstylePlugins** | List<Dependency> | A list with artifacts that contain additional checks for Checkstyle |
| **checkstyleProperties** | String | Relative path of the properties file to use in the ruleset to configure specific checks |

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<mockito.version>4.10.0</mockito.version>
<maven.resources.version>3.3.1</maven.resources.version>
<pmd.version>7.9.0</pmd.version>
<checkstyle.version>10.17.0</checkstyle.version>
<checkstyle.version>10.21.1</checkstyle.version>
<spotbugs.version>4.8.6</spotbugs.version>
<maven.core.version>3.9.9</maven.core.version>
<maven.plugin.api.version>3.9.9</maven.plugin.api.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class CheckstyleChecker extends AbstractChecker {
/**
* The version of the maven-checkstyle-plugin that will be used
*/
@Parameter(property = "maven.checkstyle.version", defaultValue = "3.4.0")
@Parameter(property = "maven.checkstyle.version", defaultValue = "3.6.0")
private String checkstyleMavenVersion;

/**
Expand Down Expand Up @@ -118,7 +118,7 @@ public void execute() throws MojoExecutionException {

checkstylePlugins.add(dependency("org.openhab.tools.sat.custom-checks", "checkstyle", plugin.getVersion()));
// Maven may load an older version, if no version is specified
checkstylePlugins.add(dependency("com.puppycrawl.tools", "checkstyle", "10.17.0"));
checkstylePlugins.add(dependency("com.puppycrawl.tools", "checkstyle", "10.21.1"));
checkstylePlugins.forEach(logDependency());

String baseDir = mavenProject.getBasedir().toString();
Expand Down

0 comments on commit 17197af

Please sign in to comment.