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

detektGenerateConfig adds the configuration of plugins #4844

Merged
merged 1 commit into from
May 22, 2022
Merged

Conversation

BraisGabin
Copy link
Member

@BraisGabin BraisGabin commented May 19, 2022

I don't know how to unit-test this. Any guidance here is more than welcome.

The problem was that we were not passing the information about the configured plugins to the cli when we were using executing detektGenerateConfig.

Fix #4812

@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

Merging #4844 (3ebbe32) into main (7cb5d96) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##               main    #4844   +/-   ##
=========================================
  Coverage     84.75%   84.75%           
  Complexity     3431     3431           
=========================================
  Files           491      491           
  Lines         11278    11278           
  Branches       2076     2076           
=========================================
  Hits           9559     9559           
  Misses          673      673           
  Partials       1046     1046           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7cb5d96...3ebbe32. Read the comment docs.

@cortinico
Copy link
Member

I don't know how to unit-test this. Any guidance here is more than welcome.

For Unit testing, we'll have to restructure a bit the DetektGenerateConfigTask. You'll have to use the ProjectBuilder + create this task passing the pluginClasspath and exercise the TaskAction.

For E2E testing, it's harder as our test infra doesn't have any support for detektPlugin or similar. We'll have to extend what we currently have.

I'm fine with merging this as it is btw as we're sufficiently test covered on this + the other Detekt and DetektCreateBaselineTask are following the same structure

@BraisGabin BraisGabin merged commit a066c7f into main May 22, 2022
@BraisGabin BraisGabin deleted the fix-4812 branch May 22, 2022 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default configuration of custom rulesets isn't merged in the resulting detekt-config.yml
2 participants