https://kotlinlang.org logo
#detekt
Title
# detekt
s

Sebastian Schuberth

03/10/2021, 11:02 PM
I'm also trying to use detekt 1.16.0 + SARIF + CodeQL Action. But for some reason the SARIF has empty
"results" : [ ]
although on the CLI I see issues. Any idea why that could be? Who wants to try, use the
detekt-action
branch from https://github.com/oss-review-toolkit/ort.
c

chao

03/11/2021, 5:51 AM
Did you upgrade to detekt 1.16?
s

Sebastian Schuberth

03/11/2021, 10:23 AM
Yes.
Looks like the issue is with merging reports. I had not enabled merging, so I'm probably overwriting the "global" report with one of the sub-project reports that has no findings.
So, when I'm using the code at https://github.com/detekt/detekt/blob/master/docs/pages/reporting.md#kotlin-dsl to merge reports, I'm getting error
Parameter specified as non-null is null: method org.gradle.kotlin.dsl.NamedDomainObjectCollectionExtensionsKt.getValue, parameter $this$getValue
, any hints what's wrong?
c

chao

03/13/2021, 7:32 AM
If you have some branches showing the code, I can help reproduce.
I consider myself a noob for kts, so I probably need more information to figure out what’s wrong
An actual closer example is here as gradle testkit integration test. I copied my test code into the documentation
s

Sebastian Schuberth

03/13/2021, 12:40 PM
Any help is appreciated. Regaring a branch to reproduce, please see my initial post: use the 
detekt-action
 branch from https://github.com/oss-review-toolkit/ort.
c

chao

03/13/2021, 6:57 PM
You need to move
Copy code
val mergeDetektReports by tasks.registering(ReportMergeTask::class) {
    output.set(rootProject.buildDir.resolve("reports/detekt/merged.sarif"))
}
ahead of
allprojects
s

Sebastian Schuberth

03/13/2021, 8:38 PM
Wow, thanks a lot, that works indeed!
PS: I just filed a PR to use finalizedBy() for the merge task, see https://github.com/detekt/detekt/pull/3548.
c

chao

03/13/2021, 9:15 PM
Sounds good. I usually do
--continue
but I guess this setup is much cleaner
@Sebastian Schuberth Is the Github action now working for you? I am trying to determine the urgency of merging https://github.com/detekt/detekt/pull/3556
s

Sebastian Schuberth

03/15/2021, 4:34 PM
Yes, it's working, though the PR is not merged yet, see https://github.com/oss-review-toolkit/ort/pull/3749
c

chao

03/15/2021, 4:34 PM
🙏
34 Views