Share a detekt report
detekt's HTML reporter produces something genuinely readable — findings
grouped by rule set, with the offending Kotlin inline. Then Gradle drops it
in build/reports/detekt/detekt.html, the build fails, and the team's entire
experience of the report is the one-line Gradle summary.
Enable the reporter, publish the file
// build.gradle.kts
tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
reports {
html.required.set(true)
sarif.required.set(true)
}
}
./gradlew detekt
curl -fsS -X PATCH "https://commareports.com/api/v1/reports/$REPORT_ID" \
-H "Authorization: Bearer $COMMA_API_TOKEN" \
-H "Content-Type: application/json" \
-d "$(jq -n --rawfile html build/reports/detekt/detekt.html \
--arg title "detekt — $GITHUB_SHA" '{title: $title, html: $html}')"
Or just drag the file into the app when you only need it once.
detekt fails the build past its threshold, so guard the publish step with
if: always() — otherwise you publish only the builds nobody needs to read.
Why publish instead of screenshot
Static analysis produces two kinds of finding, and only a human can sort them:
- Anchored threads on the finding — "suppressing this,
ComplexMethodon the parser is deliberate" — see commenting on HTML. The reasoning ends up attached to the finding rather than in a PR thread nobody will find again. - Revisions — one report id per module, one revision per build. Baseline regenerations become visible movement.
- Access per report — private, team, domain-gated, or named reviewers. See the sharing model.
Limits
- Entry HTML: 5 MB. Assets: 25 MB per file, 250 MB and 500 files total.
- 60 requests/minute per token.
Try it
Comma is free — unlimited reports, unlimited commenters, unlimited revision history.