Restore fast linters meaning (#1844)
* fix: remove useless conditions. * feat: considere revive as slow. * feat: considere linters with go analysis as slow.
This commit is contained in:
parent
cd2025d1be
commit
87d37c6cf5
@ -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 {
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
@ -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).
|
||||
|
Loading…
x
Reference in New Issue
Block a user