зеркало из https://github.com/golang/tools.git
internal/lsp/hooks: enable staticcheck hooks
Forgot to enable the staticcheck hooks when I created a struct for analyzers inside of the lsp (https://go-review.googlesource.com/c/tools/+/223662). Change-Id: Ice7798089100107113741caed3ddc41d172830b4 Reviewed-on: https://go-review.googlesource.com/c/tools/+/225837 Run-TryBot: Rohan Challa <rohan@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Paul Jolly <paul@myitcv.org.uk> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
Родитель
5d86d385bf
Коммит
8db92c5f61
|
@ -14,17 +14,17 @@ import (
|
||||||
func updateAnalyzers(options *source.Options) {
|
func updateAnalyzers(options *source.Options) {
|
||||||
if options.StaticCheck {
|
if options.StaticCheck {
|
||||||
for _, a := range simple.Analyzers {
|
for _, a := range simple.Analyzers {
|
||||||
options.Analyzers[a.Name] = source.Analyzer{Analyzer: a}
|
options.Analyzers[a.Name] = source.Analyzer{Analyzer: a, Enabled: true}
|
||||||
}
|
}
|
||||||
for _, a := range staticcheck.Analyzers {
|
for _, a := range staticcheck.Analyzers {
|
||||||
// This check conflicts with the vet printf check (golang/go#34494).
|
// This check conflicts with the vet printf check (golang/go#34494).
|
||||||
if a.Name == "SA5009" {
|
if a.Name == "SA5009" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
options.Analyzers[a.Name] = source.Analyzer{Analyzer: a}
|
options.Analyzers[a.Name] = source.Analyzer{Analyzer: a, Enabled: true}
|
||||||
}
|
}
|
||||||
for _, a := range stylecheck.Analyzers {
|
for _, a := range stylecheck.Analyzers {
|
||||||
options.Analyzers[a.Name] = source.Analyzer{Analyzer: a}
|
options.Analyzers[a.Name] = source.Analyzer{Analyzer: a, Enabled: true}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче