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

Don't fail if baseline doesn't exist in PlainDetekt #3429

Merged
merged 2 commits into from
Jan 30, 2021

Conversation

BraisGabin
Copy link
Member

Fixes #3355

At work I realised that we had some modules without it's baseline and they were working as expected. I just figured out why: we have this code

// If a baseline file is configured as input file, it must exist to be configured, otherwise the task fails.
// We try to find the configured baseline or alternatively a specific variant matching this task.
extension.baseline?.existingVariantOrBaseFile(sourceSet.name)?.let { baselineFile ->
baseline.set(layout.file(project.provider { baselineFile }))
}

for jvm and android but we don't for plain detekt. In this PR I just add that code in detekt too.

@codecov
Copy link

codecov bot commented Jan 30, 2021

Codecov Report

Merging #3429 (ca0ceed) into master (a260383) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3429      +/-   ##
============================================
- Coverage     80.37%   80.35%   -0.03%     
  Complexity     2763     2763              
============================================
  Files           450      450              
  Lines          8335     8336       +1     
  Branches       1599     1599              
============================================
- Hits           6699     6698       -1     
- Misses          774      775       +1     
- Partials        862      863       +1     
Impacted Files Coverage Δ Complexity Δ
...o/gitlab/arturbosch/detekt/internal/DetektPlain.kt 76.47% <0.00%> (-11.03%) 5.00 <0.00> (ø)
.../gitlab/arturbosch/detekt/internal/FileMangling.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)

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 a260383...200adc7. Read the comment docs.

@schalkms schalkms merged commit 6a3c4f6 into master Jan 30, 2021
@schalkms schalkms deleted the baseline-doesnt-exist branch January 30, 2021 19:32
@cortinico cortinico added this to the 1.16.0 milestone Feb 19, 2021
This was referenced Mar 11, 2021
This was referenced Mar 11, 2021
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.

Don't fail the gradle task if the baseline file doesn't exist
4 participants