Skip to content
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

Feature request: Make Detekt and DetektCreateBaselineTask implement a common interface #5940

Open
ZacSweers opened this issue Mar 25, 2023 · 5 comments
Assignees
Labels
feature gradle-plugin never gets stale Mark Issues/PRs that should not be closed as they won't get stale

Comments

@ZacSweers
Copy link
Contributor

Your feature request may already be reported!
Please search in the issues before creating a new one.

Expected Behavior

Currently, these two tasks are completely independent but have overlapping inputs. This means that if we want to configure Detekt (for example – jvmTarget), we must manually configure both types. It would be convenient if this shared configuration was extracted to a common interface (that extends Task) that could be used to configure both.

Current Behavior

project.tasks.configureEach<Detekt> {
  this.jvmTarget = jvmTarget
  exclude("**/build/**")
}
project.tasks.configureEach<DetektCreateBaselineTask> {
  this.jvmTarget = jvmTarget
  exclude("**/build/**")
}

Desired, using a name like DetektTask

project.tasks.configureEach<DetektTask> {
  // Covers both Detekt and DetektCreateBaselineTask
  this.jvmTarget = jvmTarget
  exclude("**/build/**")
}

Context

@atulgpt
Copy link
Contributor

atulgpt commented Mar 27, 2023

Hi @ZacSweers are you talking something similar to #5946 ?

@ZacSweers
Copy link
Contributor Author

Yup! Note you can use the Task interface rather than DefaultTask and then you don't need to make the base task also a SourceTask (since the baseline task wasn't one before). Then the base task can also be an interface

@atulgpt
Copy link
Contributor

atulgpt commented Mar 27, 2023

since the baseline task wasn't one before it was SourceTask before as well. See below SS
Screenshot 2023-03-28 at 1 14 01 AM

@ZacSweers
Copy link
Contributor Author

Oh, I can't read. Nevermind!

@3flex 3flex self-assigned this Jun 13, 2023
@detekt-ci
Copy link
Collaborator

This issue is stale because it has been open 90 days with no activity. Please comment or this will be closed in 7 days.

@3flex 3flex removed the stale label Sep 11, 2023
@cortinico cortinico added the never gets stale Mark Issues/PRs that should not be closed as they won't get stale label Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature gradle-plugin never gets stale Mark Issues/PRs that should not be closed as they won't get stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants