https://kotlinlang.org logo
#detekt
Title
# detekt
m

Marco Righini

07/17/2020, 10:53 AM
Hi everybody! What’s the way to overwrite the detekt autocorrect flag (defined in
detekt
block in the gradle file) with a command line gradle task parameter? I checked the docs but I didn’t find how. I’ve also tried
./gradlew detekt -Pauto-correct=true
and
./gradlew detekt -PautoCorrect=true
along with some other similar commands but none of them worked.
b

Brais Gabin

07/17/2020, 11:01 AM
I think that this it’s not supported. Could you create an issue exaplaining your use case in the repo? I think that we should support it
g

gammax

07/17/2020, 11:03 AM
☝️ That’s not supported out of the box as we don’t annotate with
@Option
our gradle tasks. What you can do is create your own property called
autoCorrect
and then invoke your command with
-PautoCorrect=…
. But that’s part of the Gradle Property API and is unrelated to detekt
m

Marco Righini

07/17/2020, 11:12 AM
Thanks for the answer @Brais Gabin @gammax FYI https://github.com/detekt/detekt/issues/2880
👌 1
5 Views