Skip to content

Commit

Permalink
Correctly set scheme for URIs in the SARIF report output
Browse files Browse the repository at this point in the history
  • Loading branch information
3flex committed Jul 30, 2023
1 parent a135984 commit 32961f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private fun Location.toLocation(code: String?): io.github.detekt.sarif4k.Locatio
uriBaseID = SRCROOT
)
} else {
ArtifactLocation(uri = filePath.absolutePath.invariantSeparatorsPathString)
ArtifactLocation(uri = "file:///${filePath.absolutePath.invariantSeparatorsPathString}")
}
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ class SarifOutputReport : OutputReport() {
version = version
)
),
originalURIBaseIDS = basePath?.let { mapOf(SRCROOT to ArtifactLocation(uri = "file://$basePath")) },
originalURIBaseIDS = basePath?.let {
mapOf(SRCROOT to ArtifactLocation(uri = "file:///$basePath"))
},
results = toResults(detektion)
)
)
Expand Down

0 comments on commit 32961f7

Please sign in to comment.