Fix forbidigo linter name in reports (#1590)
Fix cut-and-paste error with linter name. Fixes #1589
This commit is contained in:
parent
64d823cbda
commit
750b4babc7
@ -12,18 +12,17 @@ import (
|
|||||||
"github.com/golangci/golangci-lint/pkg/result"
|
"github.com/golangci/golangci-lint/pkg/result"
|
||||||
)
|
)
|
||||||
|
|
||||||
const forbidigoName = "forbidigo"
|
|
||||||
|
|
||||||
func NewForbidigo() *goanalysis.Linter {
|
func NewForbidigo() *goanalysis.Linter {
|
||||||
|
const linterName = "forbidigo"
|
||||||
var mu sync.Mutex
|
var mu sync.Mutex
|
||||||
var resIssues []goanalysis.Issue
|
var resIssues []goanalysis.Issue
|
||||||
|
|
||||||
analyzer := &analysis.Analyzer{
|
analyzer := &analysis.Analyzer{
|
||||||
Name: forbidigoName,
|
Name: linterName,
|
||||||
Doc: goanalysis.TheOnlyanalyzerDoc,
|
Doc: goanalysis.TheOnlyanalyzerDoc,
|
||||||
}
|
}
|
||||||
return goanalysis.NewLinter(
|
return goanalysis.NewLinter(
|
||||||
forbidigoName,
|
linterName,
|
||||||
"Forbids identifiers",
|
"Forbids identifiers",
|
||||||
[]*analysis.Analyzer{analyzer},
|
[]*analysis.Analyzer{analyzer},
|
||||||
nil,
|
nil,
|
||||||
@ -34,7 +33,7 @@ func NewForbidigo() *goanalysis.Linter {
|
|||||||
var res []goanalysis.Issue
|
var res []goanalysis.Issue
|
||||||
forbid, err := forbidigo.NewLinter(s.Forbid)
|
forbid, err := forbidigo.NewLinter(s.Forbid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(err, "failed to create linter %q", forbidigoName)
|
return nil, errors.Wrapf(err, "failed to create linter %q", linterName)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, file := range pass.Files {
|
for _, file := range pass.Files {
|
||||||
@ -46,7 +45,7 @@ func NewForbidigo() *goanalysis.Linter {
|
|||||||
res = append(res, goanalysis.NewIssue(&result.Issue{
|
res = append(res, goanalysis.NewIssue(&result.Issue{
|
||||||
Pos: hint.Position(),
|
Pos: hint.Position(),
|
||||||
Text: hint.Details(),
|
Text: hint.Details(),
|
||||||
FromLinter: makezeroName,
|
FromLinter: linterName,
|
||||||
}, pass))
|
}, pass))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user