Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore fast linters meaning #1844

Merged
merged 3 commits into from Mar 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/lint/linter/config.go
Expand Up @@ -35,7 +35,7 @@ func (lc *Config) ConsiderSlow() *Config {
}

func (lc *Config) IsSlowLinter() bool {
return lc.IsSlow || (lc.LoadMode&packages.NeedTypesInfo != 0 && lc.LoadMode&packages.NeedDeps != 0)
return lc.IsSlow
}

func (lc *Config) WithLoadFiles() *Config {
Expand All @@ -46,6 +46,7 @@ func (lc *Config) WithLoadFiles() *Config {
func (lc *Config) WithLoadForGoAnalysis() *Config {
lc = lc.WithLoadFiles()
lc.LoadMode |= packages.NeedImports | packages.NeedDeps | packages.NeedExportsFile | packages.NeedTypesSizes
lc.IsSlow = true
return lc
}

Expand Down
1 change: 1 addition & 0 deletions pkg/lint/lintersdb/manager.go
Expand Up @@ -376,6 +376,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
WithURL("https://github.com/nishanths/predeclared"),
linter.NewConfig(golinters.NewRevive(reviveCfg)).
WithPresets(linter.PresetStyle).
ConsiderSlow().
WithURL("https://github.com/mgechev/revive"),
linter.NewConfig(golinters.NewDurationCheck()).
WithPresets(linter.PresetBugs).
Expand Down