feat: add the gosmopolitan linter (#3458)

This commit is contained in:
WÁNG Xuěruì 2023-03-26 06:35:39 +08:00 committed by GitHub
parent b29a4f6dc0
commit 553d7df585
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 223 additions and 0 deletions

View file

@ -135,6 +135,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
gomodguardCfg *config.GoModGuardSettings
gosecCfg *config.GoSecSettings
gosimpleCfg *config.StaticCheckSettings
gosmopolitanCfg *config.GosmopolitanSettings
govetCfg *config.GovetSettings
grouperCfg *config.GrouperSettings
ifshortCfg *config.IfshortSettings
@ -213,6 +214,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
gomodguardCfg = &m.cfg.LintersSettings.Gomodguard
gosecCfg = &m.cfg.LintersSettings.Gosec
gosimpleCfg = &m.cfg.LintersSettings.Gosimple
gosmopolitanCfg = &m.cfg.LintersSettings.Gosmopolitan
govetCfg = &m.cfg.LintersSettings.Govet
grouperCfg = &m.cfg.LintersSettings.Grouper
ifshortCfg = &m.cfg.LintersSettings.Ifshort
@ -558,6 +560,12 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
WithAlternativeNames(megacheckName).
WithURL("https://github.com/dominikh/go-tools/tree/master/simple"),
linter.NewConfig(golinters.NewGosmopolitan(gosmopolitanCfg)).
WithSince("v1.53.0").
WithLoadForGoAnalysis().
WithPresets(linter.PresetBugs).
WithURL("https://github.com/xen0n/gosmopolitan"),
linter.NewConfig(golinters.NewGovet(govetCfg)).
WithSince("v1.0.0").
WithLoadForGoAnalysis().