Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkstyle with checkstyle 9.3 #12

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,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
}
9 changes: 4 additions & 5 deletions config/checkstyle/README.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<suppress checks="JavadocMethod" files=".*"/>
<suppress checks="JavadocParagraph" files=".*"/>
<suppress checks="JavadocTagContinuationIndentation" files=".*"/>
<suppress checks="MissingJavadocType" files=".*"/>
<suppress checks="SingleLineJavadoc" files=".*"/>
<suppress checks="SummaryJavadoc" files=".*"/>
</suppressions>
540 changes: 333 additions & 207 deletions config/checkstyle/checkstyle.xml

Large diffs are not rendered by default.

535 changes: 331 additions & 204 deletions config/checkstyle/google_checks.xml

Large diffs are not rendered by default.

21 changes: 17 additions & 4 deletions embulk-guess-bzip2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ configurations {
}

tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
options.encoding = "UTF-8"
}

Expand Down Expand Up @@ -67,6 +67,19 @@ javadocJar {
}
}

// A safer and strict alternative to: "dependencies" (and "dependencies --write-locks")
//
// This task fails explicitly when the specified dependency is not available.
// In contrast, "dependencies (--write-locks)" does not fail even when a part the dependencies are unavailable.
//
// https://docs.gradle.org/8.7/userguide/dependency_locking.html#generating_and_updating_dependency_locks
task checkDependencies {
notCompatibleWithConfigurationCache("The task \"checkDependencies\" filters configurations at execution time.")
doLast {
configurations.findAll { it.canBeResolved }.each { it.resolve() }
}
}

publishing {
publications {
maven(MavenPublication) {
Expand Down Expand Up @@ -154,11 +167,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
}
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ commons-codec = "1.16.1"
commons-io = "2.16.1"
commons-lang3 = "3.14.0"

checkstyle = "9.3"

[libraries]

embulk-spi = { group = "org.embulk", name = "embulk-spi", version.ref = "embulk-spi" }
Expand Down
Loading