fix: store and read severity from linters in the cache (#4468)

This commit is contained in:
Ludovic Fernandez 2024-03-09 15:28:42 +01:00 committed by GitHub
parent 1cabafc3b6
commit 7e2840b92e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -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

View File

@ -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,
@ -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,