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

@ -61,6 +61,12 @@ var defaultLintersSettings = LintersSettings{
Gosec: GoSecSettings{
Concurrency: runtime.NumCPU(),
},
Gosmopolitan: GosmopolitanSettings{
AllowTimeLocal: false,
EscapeHatches: []string{},
IgnoreTests: true,
WatchForScripts: []string{"Han"},
},
Ifshort: IfshortSettings{
MaxDeclLines: 1,
MaxDeclChars: 30,
@ -167,6 +173,7 @@ type LintersSettings struct {
Gomodguard GoModGuardSettings
Gosec GoSecSettings
Gosimple StaticCheckSettings
Gosmopolitan GosmopolitanSettings
Govet GovetSettings
Grouper GrouperSettings
Ifshort IfshortSettings
@ -449,6 +456,13 @@ type GoSecSettings struct {
Concurrency int `mapstructure:"concurrency"`
}
type GosmopolitanSettings struct {
AllowTimeLocal bool `mapstructure:"allow-time-local"`
EscapeHatches []string `mapstructure:"escape-hatches"`
IgnoreTests bool `mapstructure:"ignore-tests"`
WatchForScripts []string `mapstructure:"watch-for-scripts"`
}
type GovetSettings struct {
Go string `mapstructure:"-"`
CheckShadowing bool `mapstructure:"check-shadowing"`