Update staticcheck and cache go/analysis facts ()

* update staticcheck

Don't fork staticcheck: use the upstream version.
Remove unneeded SSA loading.

* Cache go/analysis facts

Don't load unneeded packages for go/analysis.
Repeated run of go/analysis linters now 10x faster
(2s vs 20s on this repo) than before.
This commit is contained in:
Isaev Denis 2019-09-17 08:42:16 +03:00 committed by GitHub
parent 0e0cd753d2
commit 6a979fb40d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
149 changed files with 19031 additions and 9474 deletions

View file

@ -25,7 +25,7 @@ func getEnabledByDefaultFastLintersExcept(except ...string) []string {
ebdl := m.GetAllEnabledByDefaultLinters()
ret := []string{}
for _, lc := range ebdl {
if lc.NeedsDepsTypeInfo {
if lc.IsSlowLinter() {
continue
}
@ -41,7 +41,7 @@ func getAllFastLintersWith(with ...string) []string {
linters := lintersdb.NewManager(nil).GetAllSupportedLinterConfigs()
ret := append([]string{}, with...)
for _, lc := range linters {
if lc.NeedsDepsTypeInfo {
if lc.IsSlowLinter() {
continue
}
ret = append(ret, lc.Name())
@ -64,7 +64,7 @@ func getEnabledByDefaultFastLintersWith(with ...string) []string {
ebdl := lintersdb.NewManager(nil).GetAllEnabledByDefaultLinters()
ret := append([]string{}, with...)
for _, lc := range ebdl {
if lc.NeedsDepsTypeInfo {
if lc.IsSlowLinter() {
continue
}