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

Introduce add finding to baseline action #270

Merged
merged 1 commit into from Sep 20, 2022
Merged

Conversation

arturbosch
Copy link
Member

@arturbosch arturbosch commented Aug 21, 2022

Needs support in tooling-api detekt/detekt#5239

val settings = project.service<DetektPluginSettings>()
if (project.isBaselineDefined()) {
val provider = BaselineProvider.load()
val baselinePath = Path(settings.baselinePath)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each Gradle module can have its own Detekt baseline, right? I mean right now, all IDEA knows is what's set manually in Settings. Is it possible to work towards supporting this fully, or it would need changes to the Gradle integration of IDEA?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically yes, this would be the state we want to achieve in the end.
A bit in the direction of #276.
The IntelliJ plugin should detect all config and baseline files automatically per module basis.
We do not communicate with the Gradle subsystem in IJ for now.
Idk if it would be possible to get the DetektExtension information from Gradle through IJ.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related #109

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the way you communicate with the Gradle build is to hook into the sync process, inject your own code, expose it via an extension point and access it from the Detekt IJ plugin. @lamba92 please correct me if I'm wrong

@arturbosch arturbosch merged commit 230bf8a into main Sep 20, 2022
@arturbosch arturbosch deleted the baseline-action branch September 20, 2022 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants