Skip to content

Commit bb60a33

Browse files
committed
Checkstyle with checkstyle 9.3
1 parent 95ee94c commit bb60a33

File tree

7 files changed

+691
-423
lines changed

7 files changed

+691
-423
lines changed

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,11 @@ tasks.withType(Checkstyle) {
189189
}
190190

191191
checkstyle {
192-
toolVersion "8.7"
192+
toolVersion = libs.versions.checkstyle.get()
193193
configFile = file("${rootProject.projectDir}/config/checkstyle/checkstyle.xml")
194194
configProperties = [
195-
"checkstyle.config.path": file("${projectDir}/config/checkstyle")
195+
"org.checkstyle.google.suppressionfilter.config": file("${rootProject.projectDir}/config/checkstyle/checkstyle-suppressions.xml"),
196196
]
197197
ignoreFailures = false
198-
maxWarnings = 0 // https://github.com/gradle/gradle/issues/881
198+
maxWarnings = 0
199199
}

config/checkstyle/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
Checkstyle for the Embulk project
22
==================================
33

4-
* google_check.xml: Downloaded from: https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
5-
* Commit: 60f41e3c16e6c94b0bf8c2e5e4b4accf4ad394ab
4+
* google_check.xml: Downloaded from: https://github.com/checkstyle/checkstyle/blob/checkstyle-9.3/src/main/resources/google_checks.xml
5+
* Commit: 5c1903792f8432243cc8ae5cd79a03a004d3c09c
66
* checkstyle.xml: Customized from google_check.xml.
7-
* To enable suppressions through suppressions.xml.
7+
* To enable suppressions through checkstyle-suppressions.xml.
88
* To enable suppressions with @SuppressWarnings.
9-
* To accept package names with underscores.
109
* To indent with 4-column spaces.
11-
* To limit columns to 180 characters, which will be shortened later.
10+
* To limit columns to 180 characters.
1211
* To reject unused imports.

config/checkstyle/suppressions.xml renamed to config/checkstyle/checkstyle-suppressions.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<suppress checks="JavadocMethod" files=".*"/>
99
<suppress checks="JavadocParagraph" files=".*"/>
1010
<suppress checks="JavadocTagContinuationIndentation" files=".*"/>
11+
<suppress checks="MissingJavadocType" files=".*"/>
1112
<suppress checks="SingleLineJavadoc" files=".*"/>
1213
<suppress checks="SummaryJavadoc" files=".*"/>
1314
</suppressions>

config/checkstyle/checkstyle.xml

Lines changed: 333 additions & 207 deletions
Large diffs are not rendered by default.

config/checkstyle/google_checks.xml

Lines changed: 331 additions & 204 deletions
Large diffs are not rendered by default.

embulk-guess-bzip2/build.gradle

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ configurations {
2020
}
2121

2222
tasks.withType(JavaCompile) {
23-
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
23+
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
2424
options.encoding = "UTF-8"
2525
}
2626

@@ -67,6 +67,19 @@ javadocJar {
6767
}
6868
}
6969

70+
// A safer and strict alternative to: "dependencies" (and "dependencies --write-locks")
71+
//
72+
// This task fails explicitly when the specified dependency is not available.
73+
// In contrast, "dependencies (--write-locks)" does not fail even when a part the dependencies are unavailable.
74+
//
75+
// https://docs.gradle.org/8.7/userguide/dependency_locking.html#generating_and_updating_dependency_locks
76+
task checkDependencies {
77+
notCompatibleWithConfigurationCache("The task \"checkDependencies\" filters configurations at execution time.")
78+
doLast {
79+
configurations.findAll { it.canBeResolved }.each { it.resolve() }
80+
}
81+
}
82+
7083
publishing {
7184
publications {
7285
maven(MavenPublication) {
@@ -154,11 +167,11 @@ tasks.withType(Checkstyle) {
154167
}
155168

156169
checkstyle {
157-
toolVersion "8.7"
170+
toolVersion = libs.versions.checkstyle.get()
158171
configFile = file("${rootProject.projectDir}/config/checkstyle/checkstyle.xml")
159172
configProperties = [
160-
"checkstyle.config.path": file("${rootProject.projectDir}/config/checkstyle")
173+
"org.checkstyle.google.suppressionfilter.config": file("${rootProject.projectDir}/config/checkstyle/checkstyle-suppressions.xml"),
161174
]
162175
ignoreFailures = false
163-
maxWarnings = 0 // https://github.com/gradle/gradle/issues/881
176+
maxWarnings = 0
164177
}

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ commons-codec = "1.16.1"
2020
commons-io = "2.16.1"
2121
commons-lang3 = "3.14.0"
2222

23+
checkstyle = "9.3"
24+
2325
[libraries]
2426

2527
embulk-spi = { group = "org.embulk", name = "embulk-spi", version.ref = "embulk-spi" }

0 commit comments

Comments
 (0)