ktlint-gradle
ktlint-gradle copied to clipboard
Baseline file not created
Using v10.1.0.
I have an Android project with many modules. In the main project build script we have the following:
subprojects {
apply plugin: 'org.jlleitschuh.gradle.ktlint'
// Global ktlint config
ktlint {
enableExperimentalRules.set(true)
baseline.set(file("my-project-ktlint-baseline.xml"))
outputColorName = "RED"
outputToConsole = true
verbose = true
reporters {
reporter "checkstyle"
}
filter {
// Exclude generated files
exclude("**/build/**")
exclude("**/KtAnalyticsEvents.kt")
}
}
}
When I run the ktlintCheck
task, the baseline file is not created.
Baseline is generated using special task - ktlintGenerateBaseline
. Will add it to project readme.
Cool, that worked.
But why did it create an empty baseline file in config/ktlint?
If you don't have any codestyle violations baseline will be empty.
But why does it create the config/ktlint folder just to put an empty baseline file in it?
Yes, make sense to not generate baseline file if there are no lint errors present.
hello everyone, how do I make ktlint not generate this file? I'm having problems running on my machine, with the following error: Exception in thread "main" java.io.FileNotFoundException: C:\Users\Path (Access is denied) however I have all permissions and I am admin of the machine :(
@gabitheiss please open a new issue and include a stack trace