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

fo2rist

10/14/2020, 10:30 PM
Does anyone know if it's possible to set Detekt threshold in gradle file and keep the configuration in .yml? Use case: I have three projects in one repo and I want to share the config, but the threshold for each project is independent.
g

gammax

10/15/2020, 6:22 AM
I think you should be able to achieve this by merging different config files (and control which file to pick via Gradle).
b

Brais Gabin

10/15/2020, 7:10 AM
Related with https://github.com/detekt/detekt/issues/2267 but not the same.
And I agree with @gammax, merging configs is the way to do it right now.
f

fo2rist

10/15/2020, 1:33 PM
Thanks, folks!
Yes the issue is exactly what I need, but seems like so far I have to do file manipulations to achieve the similar result.
t

taso

10/26/2020, 1:57 PM
self-plug: There is this plug-in you can use that handles the thresholds for you. It's pretty easy to setup the thresholds per module. You can even have custom logic to evaluate if you want to fail the build or not. https://github.com/GradleUp/static-analysis-plugin/
👍 1
5 Views