Skip to content

Instantly share code, notes, and snippets.

@pavelkorolevxyz
Last active December 16, 2022 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavelkorolevxyz/c36c47e91973cc734d7d8d04abbde51c to your computer and use it in GitHub Desktop.
Save pavelkorolevxyz/c36c47e91973cc734d7d8d04abbde51c to your computer and use it in GitHub Desktop.
Gradle convention plugin with task to convert SARIF reports to Code Climate format
import se.bjurr.violations.gradle.plugin.ViolationsTask
plugins {
id("se.bjurr.violations.violations-gradle-plugin")
}
val outputReportFile = file("$buildDir/reports/violations/code-climate.json")
tasks.register<ViolationsTask>("violations") {
doFirst {
outputReportFile.parentFile.mkdirs()
}
codeClimateFile = outputReportFile
violations = listOf(
listOf("SARIF", buildDir.path, ".*/reports/detekt/report.sarif", "sarif"),
)
}
@pavelkorolevxyz
Copy link
Author

Dependency used
implementation(se.bjurr.violations:violations-gradle-plugin:1.52.2)

@pavelkorolevxyz
Copy link
Author

Could be used like this

plugins {
  id("violations")
}

and running task from the same module

./gradlew violations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment