Skip to content

Commit 87d37c6

Browse files
authored
Restore fast linters meaning (#1844)
* fix: remove useless conditions. * feat: considere revive as slow. * feat: considere linters with go analysis as slow.
1 parent cd2025d commit 87d37c6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pkg/lint/linter/config.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func (lc *Config) ConsiderSlow() *Config {
3535
}
3636

3737
func (lc *Config) IsSlowLinter() bool {
38-
return lc.IsSlow || (lc.LoadMode&packages.NeedTypesInfo != 0 && lc.LoadMode&packages.NeedDeps != 0)
38+
return lc.IsSlow
3939
}
4040

4141
func (lc *Config) WithLoadFiles() *Config {
@@ -46,6 +46,7 @@ func (lc *Config) WithLoadFiles() *Config {
4646
func (lc *Config) WithLoadForGoAnalysis() *Config {
4747
lc = lc.WithLoadFiles()
4848
lc.LoadMode |= packages.NeedImports | packages.NeedDeps | packages.NeedExportsFile | packages.NeedTypesSizes
49+
lc.IsSlow = true
4950
return lc
5051
}
5152

pkg/lint/lintersdb/manager.go

+1
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
376376
WithURL("https://github.com/nishanths/predeclared"),
377377
linter.NewConfig(golinters.NewRevive(reviveCfg)).
378378
WithPresets(linter.PresetStyle).
379+
ConsiderSlow().
379380
WithURL("https://github.com/mgechev/revive"),
380381
linter.NewConfig(golinters.NewDurationCheck()).
381382
WithPresets(linter.PresetBugs).

0 commit comments

Comments
 (0)