Skip to content

Commit 7e2840b

Browse files
authored
fix: store and read severity from linters in the cache (#4468)
1 parent 1cabafc commit 7e2840b

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

pkg/golinters/goanalysis/issue.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func NewIssue(issue *result.Issue, pass *analysis.Pass) Issue {
2323
type EncodingIssue struct {
2424
FromLinter string
2525
Text string
26+
Severity string
2627
Pos token.Position
2728
LineRange *result.Range
2829
Replacement *result.Replacement

pkg/golinters/goanalysis/runners.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ func saveIssuesToCache(allPkgs []*packages.Package, pkgsFromCache map[*packages.
151151
encodedIssues = append(encodedIssues, EncodingIssue{
152152
FromLinter: i.FromLinter,
153153
Text: i.Text,
154+
Severity: i.Severity,
154155
Pos: i.Pos,
155156
LineRange: i.LineRange,
156157
Replacement: i.Replacement,
@@ -222,6 +223,7 @@ func loadIssuesFromCache(pkgs []*packages.Package, lintCtx *linter.Context,
222223
issues = append(issues, result.Issue{
223224
FromLinter: i.FromLinter,
224225
Text: i.Text,
226+
Severity: i.Severity,
225227
Pos: i.Pos,
226228
LineRange: i.LineRange,
227229
Replacement: i.Replacement,

0 commit comments

Comments
 (0)