Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pkg/printers/sarif.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ func (p Sarif) Print(issues []result.Issue) error {
issue := issues[i]

severity := issue.Severity
if severity == "" {

switch severity {
// https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/sarif-v2.1.0-errata01-os-complete.html#_Toc141790898
case "none", "note", "warning", "error":
// Valid levels.
default:
severity = "error"
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/printers/sarif_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestSarif_Print(t *testing.T) {
},
{
FromLinter: "linter-a",
Severity: "error",
Severity: "low",
Text: "some issue 2",
Pos: token.Position{
Filename: "path/to/filec.go",
Expand Down