Closed pavlo-kravchenko closed 1 year ago
But baseline not used. Used only detekt-baseline.xml from app (if exist) or not used baseline.
Are you invoking detekt
or detetkMain
?
Which project are you applying this to (Android/JVM/KMP)?
But baseline not used. Used only detekt-baseline.xml from app (if exist) or not used baseline.
Are you invoking
detekt
ordetetkMain
? Which project are you applying this to (Android/JVM/KMP)?
detekt Android
If you define the baseline like this: file("config/detekt/baseline.xml")
I don't get how you get a baseline file called detekt-baseline.xml
, it should be named baseline.xml
. Could you provide a reproducer?
If you define the baseline like this:
file("config/detekt/baseline.xml")
I don't get how you get a baseline file calleddetekt-baseline.xml
, it should be namedbaseline.xml
. Could you provide a reproducer?
I created detekt-baseline.xml
with help command detektBaseline
Renamed detekt-baseline.xml
to baseline.xml
Moved from app/
to config/detekt/
And run detekt
Have error
But
If I run detektBaseline
again and created detekt-baseline.xml
in app/
and run detekt
it works
From this I conclude What setting a custom path for baseline doesn't work
Ok! So you are complaining about the path. Not the beaseline feature.
I tried to reproduce your issue and it works as expected on my end. a baseline is created in app/config/detekt/baseline.xml
. For sure, if I move it anywhere else it stops working. baseline = file("config/detekt/baseline.xml")
is a relative path (relative to the gradle project). It's not an absolute path.
The strange thing is that you say that detektBaseline
generates the file named detekt-baseline.xml
and then you need to rename it. detekt-baseline.xml
is the default value, but it's strange that we are taking that default value. Could you provide a reproducer project? I can't reproduce your issue on my project.
This issue is stale because it has been open 90 days with no activity. Please comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
The issue arises when I move the detekt-baseline.xml file from its default path (project/app/detekt-baseline.xml) to a new location (project/config/detekt/detekt-baseline.xml). When I attempt to run gradle app:detekt, the Gradle tool in Android Studio fails to recognize the new path. But when i run it from command line(./gradlew detekt) it work properly.
detekt {
buildUponDefaultConfig = false
allRules = false
config.setFrom("$projectDir/config/detekt/detekt.yml")
baseline = file("$projectDir/config/detekt/detekt-baseline.xml")
disableDefaultRuleSets = false
debug = false
enableCompilerPlugin = true
}
I have investigated bug 3985 and it should be fixed. But I run into it again in version 1.20.0
I write
In my
allprojects { }
But baseline not used. Used only detekt-baseline.xml from app (if exist) or not used baseline.