ktlintCheck task does not fail on Windows
See original GitHub issueHello Ktlint-Gradle team.
I’m facing the strange issue.
When I’m running the local ktlint check via ./gradlew clean ktlintCheck
the “mainSourceSetCheck” task completes successfully.
But when I’m running the same process in docker build
environment the result is different and it fails.
I’ve found the same problem on StackOverflow: https://stackoverflow.com/questions/63863368/ktlint-check-doesnt-work-locally-anymore-it-works-tho-in-my-docker-image-buil
Versions I’m using:
- Gradle wrapper 6.6.1-bin.zip
- OpenJDK 14.0.2
- Kotlin version 1.4.10
- Ktlint-gradle plugin 9.4.0
The java --version
output in the local and docker environment is the same:
openjdk 14.0.2 2020-07-14
OpenJDK Runtime Environment (build 14.0.2+12-46)
OpenJDK 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing)
Local environment check outputs the following message [DEBUG] <...>ms / 0 file(s) / 0 error(s)
whereas the docker environment outputs the [DEBUG] <...>ms / 1 file(s) / 1 error(s)
I’ve also made a minimum reproducible example. You may found it here: https://github.com/santelos/ktlint-mre
build.gradle.kts
repositories {
mavenCentral()
}
plugins {
kotlin("jvm") version "1.4.10"
id("org.jlleitschuh.gradle.ktlint") version "9.4.0"
}
ktlint {
debug.set(true)
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "14"
}
Dockerfile
FROM openjdk:14.0.2
WORKDIR /build
COPY . .
RUN java --version
RUN ./gradlew clean ktlintCheck
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6
Top GitHub Comments
Thanks, @Tapchicoma The Windows community is happy now 😁
I could reproduce it on the windows machine using sample project. Looking into it 👀