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.
8 "golang.org/x/tools/go/analysis"
9 "golang.org/x/tools/internal/lsp/source"
10 "honnef.co/go/tools/simple"
11 "honnef.co/go/tools/staticcheck"
12 "honnef.co/go/tools/stylecheck"
15 func updateAnalyzers(options *source.Options) {
16 var analyzers []*analysis.Analyzer
17 for _, a := range simple.Analyzers {
18 analyzers = append(analyzers, a)
20 for _, a := range staticcheck.Analyzers {
23 // This check conflicts with the vet printf check (golang/go#34494).
25 // This check relies on facts from dependencies, which
26 // we don't currently compute.
28 analyzers = append(analyzers, a)
31 for _, a := range stylecheck.Analyzers {
32 analyzers = append(analyzers, a)
34 // Always add hooks for all available analyzers, but disable them if the
35 // user does not have staticcheck enabled (they may enable it later on).
36 for _, a := range analyzers {
37 options.AddStaticcheckAnalyzer(a)