diff --git a/build.gradle b/build.gradle index 37934292b..6cda7c317 100644 --- a/build.gradle +++ b/build.gradle @@ -173,11 +173,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("${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/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/gradle/libs.versions.toml b/gradle/libs.versions.toml index c7b59b408..e43f3adf4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -16,6 +16,8 @@ jackson = "2.16.2" embulk-util-file = "0.1.5" embulk-util-timestamp = "0.2.2" +checkstyle = "9.3" + [libraries] embulk-spi = { group = "org.embulk", name = "embulk-spi", version.ref = "embulk-spi" }