Replies: 3 comments 3 replies
-
detekt doesn't allow right now to have multiple configurations. Well... I imagine that if you configure two different tasks you should be able to do that but that's work that you should do on your gradle. It's not provided out of the box. If you provides two different configuration files the entires of the second one overwrite the ones in the first one |
Beta Was this translation helpful? Give feedback.
-
I'd echo what @BraisGabin already said. You can create your own custom tasks with different configs. On top of this, you can use the |
Beta Was this translation helpful? Give feedback.
-
Ok, thank you very much for your help. Is it also the case that both are always used, even if I use detektMain and detektTest? Or is the detekt-main.yml and detekt-test.yml used respectively? I am currently trying to solve it with these two tasks. But then type resolution is activated (which I think is good). But I don't manage to teach type resolution to my baseline task in the multi module project... do you have an idea what is missing?
|
Beta Was this translation helpful? Give feedback.
-
Hello,
I have configured a multi module project with gradle as follows:
buildSrc/src/main/kotlin/detekt-conventions.gradle.kts:
(used in the modules)
detektBaselineMultiModule generates me the correct baseline in which violations from test are also ignored.
The Problem:
If i disable a check in the detekt.yml but not in the detekt-test.yml, the check in the main sources still applies on the 'detekt' task. Probably because detekt-test.yml is more specific? (the baseline is working correctly)
I would have expected detekt-test.yml to apply only to the test resources?
One of my solutions was to use the 'detektMain' and 'detektTest' task separately instead of 'detekt'. But they didn't seem to use the baseline at all. I do not understand that yet. Do I have to configure this differently?
Thank you for your help!
Beta Was this translation helpful? Give feedback.
All reactions