Skip to content

Commit

Permalink
Fix SARIF validation failure (#3507)
Browse files Browse the repository at this point in the history
  • Loading branch information
chao2zhang committed Mar 1, 2021
1 parent c90eafe commit 7cf1ab3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ class SarifOutputReport : OutputReport() {
@OptIn(UnstableApi::class)
override fun init(context: SetupContext) {
this.config = context.config
this.basePath = context.getOrNull<Path>(DETEKT_OUTPUT_REPORT_BASE_PATH_KEY)?.toAbsolutePath()?.toUnifiedString()
this.basePath = context.getOrNull<Path>(DETEKT_OUTPUT_REPORT_BASE_PATH_KEY)
?.toAbsolutePath()
?.toUnifiedString()
?.let {
if (!it.endsWith("/")) "$it/" else it
}
}

override fun render(detektion: Detektion): String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"originalUriBaseIds": {
"%SRCROOT%": {
"uri": "file:///Users/tester/detekt"
"uri": "file:///Users/tester/detekt/"
}
},
"results": [
Expand Down

0 comments on commit 7cf1ab3

Please sign in to comment.