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.