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
RFC: detekt
Gradle task defaults
#7018
Comments
Instead of Also, what will happen with the plain detekt on JVM, for example? Would we create a new task or would we not even create a task for them? I think that we shouldn't lose "plain detekt". It is clearly less powerful than the one with type-solving but it is also way faster so I cab see use cases to use that one. Apart from that I agree with the proposal. |
The advantage of not doing that is we don't need to dig into the Android DSL to figure that out. "release" is a sensible default and in line with the rest of the defaults. But we have a separate issue to track that enhancement anyway as you said. It's also only supported on Android applications and libraries, but not on dynamic features or test product flavors, which makes things a bit trickier.
|
All clear! So I agree with this proposal. I still think that "default variant" would be the best option but let's keep that for the other issue :) |
Generally agree with the proposal 👍 Just one minor questions:
How are we going to handle the scenario for users that want to disable TR? I suppose that's going to be a property on the |
There are the The only thing missing would then be Gradle Kotlin DSL scripts which could either be a special task we set up in the plugin, or provide instructions to create a custom task. So rather than a toggle to enable/disable TR, both sets of tasks are always registered, and we need a way to configure which ones are linked to the lifecycle tasks (and that config should be on the extension). There are still a few bits to build out. |
Ah I see. That also makes sense then 👍 |
Expected Behavior
detekt configures itself to run a sane set of default analysis tasks when running the
check
ordetekt
task (TBC which one we link to, but that's a separate thing).I'd consider a "standard" set of tasks to analyse all default source sets for the given target, using type resolution where available. For example:
main
&test
source sets by analysing compilations.main
,test
&androidTest
source sets forrelease
build type by analysing compilations.main
&test
source sets by analysing source sets since we don't currently have type and symbols solving for non-JVM targets.main
&test
source sets by analysing source sets since we don't currently have type and symbols solving for non-JVM targets.Current Behavior
The
detekt
plain task checks main & test source source sets without type solving. This falls short:main
ortest
by defaultContext
As a first step we can wire up tasks to
detekt
and retire the plain task. This uplifts analysis capability that's run by default whendetekt
orcheck
tasks are run. This will allow further refactoring of the Gradle plugin. Configuring the linked tasks can be done separately (lots of considerations there... do we make it a simple list of strings to include, or have helpers for compilations, targets, variants, build types and flavors (most of which are target-specific).The text was updated successfully, but these errors were encountered: