fix: store and read severity from linters in the cache (#4468)
This commit is contained in:
parent
1cabafc3b6
commit
7e2840b92e
@ -23,6 +23,7 @@ func NewIssue(issue *result.Issue, pass *analysis.Pass) Issue {
|
|||||||
type EncodingIssue struct {
|
type EncodingIssue struct {
|
||||||
FromLinter string
|
FromLinter string
|
||||||
Text string
|
Text string
|
||||||
|
Severity string
|
||||||
Pos token.Position
|
Pos token.Position
|
||||||
LineRange *result.Range
|
LineRange *result.Range
|
||||||
Replacement *result.Replacement
|
Replacement *result.Replacement
|
||||||
|
@ -151,6 +151,7 @@ func saveIssuesToCache(allPkgs []*packages.Package, pkgsFromCache map[*packages.
|
|||||||
encodedIssues = append(encodedIssues, EncodingIssue{
|
encodedIssues = append(encodedIssues, EncodingIssue{
|
||||||
FromLinter: i.FromLinter,
|
FromLinter: i.FromLinter,
|
||||||
Text: i.Text,
|
Text: i.Text,
|
||||||
|
Severity: i.Severity,
|
||||||
Pos: i.Pos,
|
Pos: i.Pos,
|
||||||
LineRange: i.LineRange,
|
LineRange: i.LineRange,
|
||||||
Replacement: i.Replacement,
|
Replacement: i.Replacement,
|
||||||
@ -222,6 +223,7 @@ func loadIssuesFromCache(pkgs []*packages.Package, lintCtx *linter.Context,
|
|||||||
issues = append(issues, result.Issue{
|
issues = append(issues, result.Issue{
|
||||||
FromLinter: i.FromLinter,
|
FromLinter: i.FromLinter,
|
||||||
Text: i.Text,
|
Text: i.Text,
|
||||||
|
Severity: i.Severity,
|
||||||
Pos: i.Pos,
|
Pos: i.Pos,
|
||||||
LineRange: i.LineRange,
|
LineRange: i.LineRange,
|
||||||
Replacement: i.Replacement,
|
Replacement: i.Replacement,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user