diff --git a/build.gradle b/build.gradle index 90c1e2941..36ca699d6 100644 --- a/build.gradle +++ b/build.gradle @@ -215,13 +215,13 @@ tasks.withType(Checkstyle) { } checkstyle { - toolVersion "8.7" + toolVersion = libs.versions.checkstyle.get() configFile = file("${rootProject.projectDir}/config/checkstyle/checkstyle.xml") configProperties = [ - "checkstyle.config.path": file("${projectDir}/config/checkstyle") + "org.checkstyle.google.suppressionfilter.config": file("${rootProject.projectDir}/config/checkstyle/checkstyle-suppressions.xml"), ] ignoreFailures = false - maxWarnings = 0 // https://github.com/gradle/gradle/issues/881 + maxWarnings = 0 } // Task ":compileTestJava" somehow uses this output of task ":jar" without declaring an explicit or implicit dependency. diff --git a/config/checkstyle/README.md b/config/checkstyle/README.md index efa34b9e0..403c7363c 100644 --- a/config/checkstyle/README.md +++ b/config/checkstyle/README.md @@ -1,12 +1,11 @@ Checkstyle for the Embulk project ================================== -* google_check.xml: Downloaded from: https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml - * Commit: 60f41e3c16e6c94b0bf8c2e5e4b4accf4ad394ab +* google_check.xml: Downloaded from: https://github.com/checkstyle/checkstyle/blob/checkstyle-9.3/src/main/resources/google_checks.xml + * Commit: 5c1903792f8432243cc8ae5cd79a03a004d3c09c * checkstyle.xml: Customized from google_check.xml. - * To enable suppressions through suppressions.xml. + * To enable suppressions through checkstyle-suppressions.xml. * To enable suppressions with @SuppressWarnings. - * To accept package names with underscores. * To indent with 4-column spaces. - * To limit columns to 180 characters, which will be shortened later. + * To limit columns to 180 characters. * To reject unused imports. diff --git a/config/checkstyle/suppressions.xml b/config/checkstyle/checkstyle-suppressions.xml similarity index 89% rename from config/checkstyle/suppressions.xml rename to config/checkstyle/checkstyle-suppressions.xml index 087253ac6..aefd4d6b2 100644 --- a/config/checkstyle/suppressions.xml +++ b/config/checkstyle/checkstyle-suppressions.xml @@ -8,6 +8,7 @@ + diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index e31da0870..c70b0c4ac 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -1,242 +1,368 @@ + "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" + "https://checkstyle.org/dtds/configuration_1_3.dtd"> - + - + - + + + + + + + + + + + - - - - + - + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + - - - - + + + - - - - + + + + + + + - - - - - + + + - - - - + + + + + + + - - - - + + + + + + + + + + + - - - - + + + - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/config/checkstyle/google_checks.xml b/config/checkstyle/google_checks.xml index a6fc40b5f..515a844ac 100644 --- a/config/checkstyle/google_checks.xml +++ b/config/checkstyle/google_checks.xml @@ -1,237 +1,364 @@ + "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" + "https://checkstyle.org/dtds/configuration_1_3.dtd"> - + - + - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - - + + + - - - - + + + - - - - + + + + + + + - - - - - + + + - - - - + + + + + + + - - - - + + + + + + + + + + + - - - - + + + - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + diff --git a/embulk-guess-csv/build.gradle b/embulk-guess-csv/build.gradle index bee877e38..21850c396 100644 --- a/embulk-guess-csv/build.gradle +++ b/embulk-guess-csv/build.gradle @@ -184,11 +184,11 @@ tasks.withType(Checkstyle) { } checkstyle { - toolVersion "8.7" + toolVersion = libs.versions.checkstyle.get() configFile = file("${rootProject.projectDir}/config/checkstyle/checkstyle.xml") configProperties = [ - "checkstyle.config.path": file("${rootProject.projectDir}/config/checkstyle") + "org.checkstyle.google.suppressionfilter.config": file("${rootProject.projectDir}/config/checkstyle/checkstyle-suppressions.xml"), ] ignoreFailures = false - maxWarnings = 0 // https://github.com/gradle/gradle/issues/881 + maxWarnings = 0 } diff --git a/embulk-guess-csv_all_strings/build.gradle b/embulk-guess-csv_all_strings/build.gradle index 3db92fff9..182087dc2 100644 --- a/embulk-guess-csv_all_strings/build.gradle +++ b/embulk-guess-csv_all_strings/build.gradle @@ -185,11 +185,11 @@ tasks.withType(Checkstyle) { } checkstyle { - toolVersion "8.7" + toolVersion = libs.versions.checkstyle.get() configFile = file("${rootProject.projectDir}/config/checkstyle/checkstyle.xml") configProperties = [ - "checkstyle.config.path": file("${rootProject.projectDir}/config/checkstyle") + "org.checkstyle.google.suppressionfilter.config": file("${rootProject.projectDir}/config/checkstyle/checkstyle-suppressions.xml"), ] ignoreFailures = false - maxWarnings = 0 // https://github.com/gradle/gradle/issues/881 + maxWarnings = 0 } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8ce784541..b5957f812 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -34,6 +34,8 @@ embulk-guess-csv = "0.10.42" embulk-guess-gzip = "0.10.42" embulk-guess-json = "0.10.42" +checkstyle = "9.3" + [libraries] embulk-spi = { group = "org.embulk", name = "embulk-spi", version.ref = "embulk-spi" }