Skip to content

Fix reports not propagated to detekt task with type resolution - #3313

Merged
BraisGabin merged 1 commit into
detekt:masterfrom
picklebento:gradle
Dec 23, 2020
Merged

Fix reports not propagated to detekt task with type resolution#3313
BraisGabin merged 1 commit into
detekt:masterfrom
picklebento:gradle

Conversation

@picklebento

Copy link
Copy Markdown
Member

Configuring detekt gradle extension as below does not actually generate SARIF reports when running detekt<SourceSet> like :detektMain. The problem here is that we are merely not passing the reports in DetektExtension to reports of Detekt as a gradle task.

detekt {
    reports {
        sarif.enabled = true
    }
}

In addition to integration testing, I also manually verified through a sample project that the above is working.

@codecov

codecov Bot commented Dec 22, 2020

Copy link
Copy Markdown

Codecov Report

Merging #3313 (8aed46c) into master (75ce32e) will increase coverage by 0.23%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3313      +/-   ##
============================================
+ Coverage     80.03%   80.27%   +0.23%     
- Complexity     2669     2676       +7     
============================================
  Files           443      443              
  Lines          8140     8142       +2     
  Branches       1548     1548              
============================================
+ Hits           6515     6536      +21     
+ Misses          796      775      -21     
- Partials        829      831       +2     
Impacted Files Coverage Δ Complexity Δ
...gitlab/arturbosch/detekt/internal/DetektAndroid.kt 71.87% <100.00%> (+0.44%) 12.00 <0.00> (ø)
.../io/gitlab/arturbosch/detekt/internal/DetektJvm.kt 57.69% <100.00%> (+57.69%) 4.00 <0.00> (+4.00)
...kotlin/io/gitlab/arturbosch/detekt/DetektPlugin.kt 84.12% <0.00%> (+1.58%) 11.00% <0.00%> (ø%)
...o/gitlab/arturbosch/detekt/internal/SharedTasks.kt 61.90% <0.00%> (+4.76%) 0.00% <0.00%> (ø%)
...ab/arturbosch/detekt/extensions/DetektExtension.kt 52.63% <0.00%> (+5.26%) 7.00% <0.00%> (+1.00%)
...tlab/arturbosch/detekt/extensions/DetektReports.kt 41.17% <0.00%> (+5.88%) 6.00% <0.00%> (+1.00%)
...itlab/arturbosch/detekt/extensions/DetektReport.kt 75.00% <0.00%> (+25.00%) 3.00% <0.00%> (+1.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 75ce32e...8aed46c. Read the comment docs.

@picklebento

Copy link
Copy Markdown
Member Author

This PR is blocking me from testing the solution for #853. When possible, please merge this pull request.

@schalkms

Copy link
Copy Markdown
Member

@chao2zhang good to know. This PR will be merged asap if at least two maintainers review and approve it. Hence, I send out an review invitation.

@BraisGabin BraisGabin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice catch! And it's great to increase our test base 🙂

@BraisGabin
BraisGabin merged commit c6a971f into detekt:master Dec 23, 2020
@BraisGabin BraisGabin added this to the 1.16.0 milestone Dec 27, 2020
@picklebento
picklebento deleted the gradle branch January 4, 2021 07:41
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.

3 participants