2019-06-12 20:04:42 -06:00
|
|
|
// Copyright 2019 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package hooks
|
|
|
|
|
|
|
|
import (
|
|
|
|
"golang.org/x/tools/internal/lsp/source"
|
|
|
|
"honnef.co/go/tools/simple"
|
|
|
|
"honnef.co/go/tools/staticcheck"
|
|
|
|
"honnef.co/go/tools/stylecheck"
|
|
|
|
)
|
|
|
|
|
2019-10-10 18:48:16 -06:00
|
|
|
func updateAnalyzers(options *source.Options) {
|
|
|
|
if options.StaticCheck {
|
2019-06-12 20:04:42 -06:00
|
|
|
for _, a := range simple.Analyzers {
|
2019-11-21 16:55:49 -07:00
|
|
|
options.Analyzers[a.Name] = a
|
2019-06-12 20:04:42 -06:00
|
|
|
}
|
|
|
|
for _, a := range staticcheck.Analyzers {
|
2019-11-21 16:55:49 -07:00
|
|
|
options.Analyzers[a.Name] = a
|
2019-06-12 20:04:42 -06:00
|
|
|
}
|
|
|
|
for _, a := range stylecheck.Analyzers {
|
2019-11-21 16:55:49 -07:00
|
|
|
options.Analyzers[a.Name] = a
|
2019-06-12 20:04:42 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|