Skip to content

Commit

Permalink
fix: store and read severity from linters in the cache (#4468)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored Mar 9, 2024
1 parent 1cabafc commit 7e2840b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/golinters/goanalysis/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func NewIssue(issue *result.Issue, pass *analysis.Pass) Issue {
type EncodingIssue struct {
FromLinter string
Text string
Severity string
Pos token.Position
LineRange *result.Range
Replacement *result.Replacement
Expand Down
2 changes: 2 additions & 0 deletions pkg/golinters/goanalysis/runners.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ func saveIssuesToCache(allPkgs []*packages.Package, pkgsFromCache map[*packages.
encodedIssues = append(encodedIssues, EncodingIssue{
FromLinter: i.FromLinter,
Text: i.Text,
Severity: i.Severity,
Pos: i.Pos,
LineRange: i.LineRange,
Replacement: i.Replacement,
Expand Down Expand Up @@ -222,6 +223,7 @@ func loadIssuesFromCache(pkgs []*packages.Package, lintCtx *linter.Context,
issues = append(issues, result.Issue{
FromLinter: i.FromLinter,
Text: i.Text,
Severity: i.Severity,
Pos: i.Pos,
LineRange: i.LineRange,
Replacement: i.Replacement,
Expand Down

0 comments on commit 7e2840b

Please sign in to comment.