New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task redundancy #6984
Comments
related to #6973 |
Also related #5947 |
There is going to be some overlap in compilation analysis because different compilations can share source files, but we should have some sensible defaults when running the I'm actively working on this. |
You're right, this is a known problem. As @3flex mentioned, we're redesigning the task graph to handle scenarios exactly like this one. |
I have just discovered that I am currently executing redundant Detekt tasks.
Expected Behavior
There should be a typesafe way to depend on all normal Detekt tasks for a module. By normal, I just mean running Detekt on all kotlin code, but not any of that baseline stuff.
The way I try to do this is
myTask.dependsOn(tasks.withType<Detekt>())
. I expect this will simply makemyTask
run only after Detekt has executed on all my code.Observed Behavior
I just discovered that in some projects I have 3 detekt tasks:
detektMain
,detektTest
, anddetekt
. And I didn't even realize this before, butdetekt
is actually running all the rules again redundandly which already run indetektMain
anddetektTest
. So all rules end up getting executed twice.Steps to Reproduce
main
andtest
source setdetekt
anddetektMain
folder, and also duplicates fromdetektTest
indetekt
and that tells me the rules ran twice, redundantly.Context
The central issue here is that I expected
myTask.dependsOn(tasks.withType<Detekt>())
to simply allow me to make sure detekt is running on every source set, but I did not realize that it was also making detekt redundantly rerun analysis. As a workaround maybe I could disable thedetekt
task sincedetektMain
anddetektTest
seem to cover everything, but I think a better solution could be:or
The text was updated successfully, but these errors were encountered: