1 // Copyright 2019 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
11 "golang.org/x/tools/go/analysis"
12 "golang.org/x/tools/internal/lsp/source"
13 "honnef.co/go/tools/simple"
14 "honnef.co/go/tools/staticcheck"
15 "honnef.co/go/tools/stylecheck"
18 func updateAnalyzers(options *source.Options) {
19 var analyzers []*analysis.Analyzer
20 for _, a := range simple.Analyzers {
21 analyzers = append(analyzers, a)
23 for _, a := range staticcheck.Analyzers {
26 // This check conflicts with the vet printf check (golang/go#34494).
28 // This check relies on facts from dependencies, which
29 // we don't currently compute.
31 analyzers = append(analyzers, a)
34 for _, a := range stylecheck.Analyzers {
35 analyzers = append(analyzers, a)
37 // Always add hooks for all available analyzers, but disable them if the
38 // user does not have staticcheck enabled (they may enable it later on).
39 for _, a := range analyzers {
40 options.AddStaticcheckAnalyzer(a)