From 11cdef80aed3e3a65d6afb39a11fb29644499d72 Mon Sep 17 00:00:00 2001 From: alingse Date: Mon, 11 Jul 2022 21:08:04 +0800 Subject: [PATCH] upgarde asasalint v0.0.6, and add some note in reference.yml --- .golangci.reference.yml | 12 ++++++++---- go.mod | 2 +- go.sum | 2 ++ pkg/config/linters_settings.go | 2 +- pkg/golinters/asasalint.go | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.golangci.reference.yml b/.golangci.reference.yml index ea5b1acfde90..65314477a97a 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -108,17 +108,21 @@ output: # All available settings of specific linters. linters-settings: asasalint: - # Add FuncName to exclude for some bad case report. + # Add FuncName to exclude for avoid some bad case report. + # the asasalint has also some builtin exclude func names, not need to config here, + # and can disabled by `no-builtin-exclude` option. + # they are `Printf,Println,Fprintf,Fprintln,Fatal,Fatalf,Panic,Panicf,Panicln,Print,Printf,Println,Sprintf,Sprintln,Error,Errorf,Info,Infof,Warn,Warnf,Debug,Debugf`. # Default: [] exclude: - Append - Log # ignore found case in *_test.go file # Default: false - ignore-in-test: false - # if true, will disable the default exclude see https://github.com/alingse/asasalint/blob/main/asasalint.go#L15 like: Printf,Println,Errorf,Debugf ... + ignore-in-test: true + # if true, will disable the builtin exclude see https://github.com/alingse/asasalint/blob/main/asasalint.go#L15 like: Printf,Println,Errorf,Debugf ... # Default: false - no-default-exclude: false + no-builtin-exclude: true + bidichk: # The following configurations check for all mentioned invisible unicode runes. # All runes are enabled by default. diff --git a/go.mod b/go.mod index fa628c2c92a0..2106be30ac8d 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/GaijinEntertainment/go-exhaustruct/v2 v2.2.0 github.com/OpenPeeDeeP/depguard v1.1.0 github.com/alexkohler/prealloc v1.0.0 - github.com/alingse/asasalint v0.0.5 + github.com/alingse/asasalint v0.0.6 github.com/ashanbrown/forbidigo v1.3.0 github.com/ashanbrown/makezero v1.1.1 github.com/bkielbasa/cyclop v1.2.0 diff --git a/go.sum b/go.sum index 8d956aceef7d..a1adfa5a9b72 100644 --- a/go.sum +++ b/go.sum @@ -72,6 +72,8 @@ github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pO github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= github.com/alingse/asasalint v0.0.5 h1:/U8o+wtkyc9wsmDiyvCAcGr5uskgM2tVLNlqZJouid0= github.com/alingse/asasalint v0.0.5/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= +github.com/alingse/asasalint v0.0.6 h1:UMyvWrkrDHm9y3MhC9sVxnTIY8MwxhgxSs6ZilB6Inc= +github.com/alingse/asasalint v0.0.6/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= diff --git a/pkg/config/linters_settings.go b/pkg/config/linters_settings.go index 39a76dcc4912..f6821b27d63d 100644 --- a/pkg/config/linters_settings.go +++ b/pkg/config/linters_settings.go @@ -188,7 +188,7 @@ type LintersSettings struct { type AsasalintSettings struct { Exclude []string `mapstructure:"exclude"` IgnoreInTest bool `mapstructure:"ignore-in-test"` - NoDefaultExclude bool `mapstructure:"no-default-exclude"` + NoBuiltinExclude bool `mapstructure:"no-builtin-exclude"` } type BiDiChkSettings struct { diff --git a/pkg/golinters/asasalint.go b/pkg/golinters/asasalint.go index 07d1f1112dc8..9658d244f31d 100644 --- a/pkg/golinters/asasalint.go +++ b/pkg/golinters/asasalint.go @@ -13,7 +13,7 @@ func NewAsasalint(setting *config.AsasalintSettings) *goanalysis.Linter { if setting != nil { cfg.Exclude = setting.Exclude cfg.IgnoreInTest = setting.IgnoreInTest - cfg.NoDefaultExclude = setting.NoDefaultExclude + cfg.NoBuiltinExclude = setting.NoBuiltinExclude } a := asasalint.NewAnalyzer(cfg)