From bc5ae9be86f5c674efe9cfcc3ad0124da5980c46 Mon Sep 17 00:00:00 2001 From: Wouter Born Date: Sat, 2 Mar 2024 08:42:34 +0100 Subject: [PATCH] Upgrade Checkstyle to 10.14.0 Upgrades Checkstyle from 10.6.0 to 10.14.0. For release notes, see: https://checkstyle.sourceforge.io/releasenotes.html Signed-off-by: Wouter Born --- .../tools/analysis/checkstyle/JavadocMethodStyleCheck.java | 6 +++--- docs/maven-plugin.md | 2 +- pom.xml | 2 +- .../org/openhab/tools/analysis/tools/CheckstyleChecker.java | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/custom-checks/checkstyle/src/main/java/org/openhab/tools/analysis/checkstyle/JavadocMethodStyleCheck.java b/custom-checks/checkstyle/src/main/java/org/openhab/tools/analysis/checkstyle/JavadocMethodStyleCheck.java index 27e8930f..7950f5a6 100644 --- a/custom-checks/checkstyle/src/main/java/org/openhab/tools/analysis/checkstyle/JavadocMethodStyleCheck.java +++ b/custom-checks/checkstyle/src/main/java/org/openhab/tools/analysis/checkstyle/JavadocMethodStyleCheck.java @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.FileContents; import com.puppycrawl.tools.checkstyle.api.TextBlock; import com.puppycrawl.tools.checkstyle.api.TokenTypes; -import com.puppycrawl.tools.checkstyle.utils.CheckUtil; +import com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; /** @@ -123,8 +123,8 @@ public int[] getRequiredTokens() { @Override public void visitToken(DetailAST ast) { - boolean skipCheck = (CheckUtil.isSetterMethod(ast) || CheckUtil.isGetterMethod(ast)) - && allowMissingPropertyJavadoc; + boolean skipCheck = (MissingJavadocMethodCheck.isSetterMethod(ast) + || MissingJavadocMethodCheck.isGetterMethod(ast)) && allowMissingPropertyJavadoc; if (!skipCheck) { visit(ast); } diff --git a/docs/maven-plugin.md b/docs/maven-plugin.md index fe497337..b40f493e 100644 --- a/docs/maven-plugin.md +++ b/docs/maven-plugin.md @@ -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.1.2**)| +| **maven.checkstyle.version** | String | The version of the maven-checkstyle-plugin that will be used (default value is **3.3.1**)| | **checkstylePlugins** | List | 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 | diff --git a/pom.xml b/pom.xml index 007a0bb6..379a9fbe 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ 4.10.0 3.3.0 6.53.0 - 10.6.0 + 10.14.0 4.8.3 3.6.0 3.8.5 diff --git a/sat-plugin/src/main/java/org/openhab/tools/analysis/tools/CheckstyleChecker.java b/sat-plugin/src/main/java/org/openhab/tools/analysis/tools/CheckstyleChecker.java index 31d40536..c1242d0a 100644 --- a/sat-plugin/src/main/java/org/openhab/tools/analysis/tools/CheckstyleChecker.java +++ b/sat-plugin/src/main/java/org/openhab/tools/analysis/tools/CheckstyleChecker.java @@ -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.2.1") + @Parameter(property = "maven.checkstyle.version", defaultValue = "3.3.1") private String checkstyleMavenVersion; /** @@ -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.6.0")); + checkstylePlugins.add(dependency("com.puppycrawl.tools", "checkstyle", "10.14.0")); checkstylePlugins.forEach(logDependency()); String baseDir = mavenProject.getBasedir().toString();