Skip to content

Commit b4191a7

Browse files
authored
Merge pull request #60 from embulk/checkstyle-9.3
Checkstyle with checkstyle 9.3
2 parents 1822be7 + 83a29fe commit b4191a7

18 files changed

+1027
-696
lines changed

build.gradle

+16-16
Original file line numberDiff line numberDiff line change
@@ -223,31 +223,31 @@ gemPush {
223223
}
224224

225225
test {
226-
jvmArgs '-XX:MaxPermSize=128M', '-Xmx2048m'
226+
jvmArgs "-XX:MaxPermSize=128M", "-Xmx2048m"
227227
testLogging {
228-
outputs.upToDateWhen { false }
228+
events "passed", "skipped", "failed", "standardOut", "standardError"
229229
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
230230
showCauses = true
231231
showExceptions = true
232232
showStackTraces = true
233233
showStandardStreams = true
234-
events "passed", "skipped", "failed", "standardOut", "standardError"
234+
outputs.upToDateWhen { false }
235235
}
236236
}
237237

238-
checkstyle {
239-
configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml")
240-
toolVersion = '6.14.1'
241-
}
242-
checkstyleMain {
243-
configFile = file("${project.rootDir}/config/checkstyle/default.xml")
244-
ignoreFailures = false
238+
tasks.withType(Checkstyle) {
239+
reports {
240+
// Not to skip up-to-date checkstyles.
241+
outputs.upToDateWhen { false }
242+
}
245243
}
246-
checkstyleTest {
247-
configFile = file("${project.rootDir}/config/checkstyle/default.xml")
244+
245+
checkstyle {
246+
toolVersion = libs.versions.checkstyle.get()
247+
configFile = file("${rootProject.projectDir}/config/checkstyle/checkstyle.xml")
248+
configProperties = [
249+
"org.checkstyle.google.suppressionfilter.config": file("${rootProject.projectDir}/config/checkstyle/checkstyle-suppressions.xml"),
250+
]
248251
ignoreFailures = false
249-
}
250-
task checkstyle(type: Checkstyle) {
251-
classpath = sourceSets.main.output + sourceSets.test.output
252-
source = sourceSets.main.allJava + sourceSets.test.allJava
252+
maxWarnings = 0
253253
}

config/checkstyle/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Checkstyle for the Embulk project
2+
==================================
3+
4+
* google_check.xml: Downloaded from: https://github.com/checkstyle/checkstyle/blob/checkstyle-9.3/src/main/resources/google_checks.xml
5+
* Commit: 5c1903792f8432243cc8ae5cd79a03a004d3c09c
6+
* checkstyle.xml: Customized from google_check.xml.
7+
* To enable suppressions through checkstyle-suppressions.xml.
8+
* To enable suppressions with @SuppressWarnings.
9+
* To indent with 4-column spaces.
10+
* To limit columns to 180 characters.
11+
* To reject unused imports.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0"?>
2+
3+
<!DOCTYPE suppressions PUBLIC
4+
"-//Puppy Crawl//DTD Suppressions 1.2//EN"
5+
"http://checkstyle.sourceforge.net/dtds/suppressions_1_2.dtd">
6+
7+
<suppressions>
8+
<suppress checks="JavadocMethod" files=".*"/>
9+
<suppress checks="JavadocParagraph" files=".*"/>
10+
<suppress checks="JavadocTagContinuationIndentation" files=".*"/>
11+
<suppress checks="MissingJavadocType" files=".*"/>
12+
<suppress checks="SingleLineJavadoc" files=".*"/>
13+
<suppress checks="SummaryJavadoc" files=".*"/>
14+
</suppressions>

0 commit comments

Comments
 (0)