From 491e6cef09c55910ce4ffc2899fb4b94ee22b0ee Mon Sep 17 00:00:00 2001 From: mh-swift Date: Tue, 9 Jul 2024 17:07:05 +0800 Subject: [PATCH] =?UTF-8?q?chore(golangci-lint):=20lint=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=80=A7=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/.golangci.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/server/.golangci.yml b/server/.golangci.yml index 99fa62e..e9d75e8 100644 --- a/server/.golangci.yml +++ b/server/.golangci.yml @@ -13,14 +13,15 @@ run: # Include test files or not. # Default: true tests: false + go: "1.20" # Which dirs to skip: issues from them won't be reported. # Can use regexp here: `generated.*`, regexp is applied on full path. # Default value is empty list, # but default dirs are skipped independently of this option's value (see skip-dirs-use-default). # "/" will be replaced by current OS file path separator to properly work on Windows. - skip-dirs: - - internal/library/hggen/internal + # skip-dirs: + # - internal/library/hggen/internal # Which files to skip: they will be analyzed, but issues from them won't be reported. # Default value is empty list, @@ -28,7 +29,7 @@ run: # we confidently recognize autogenerated files. # If it's not please let us know. # "/" will be replaced by current OS file path separator to properly work on Windows. - skip-files: [] + # skip-files: [] # Main linters configurations. @@ -71,7 +72,10 @@ issues: - linters: - gocritic text: "unnecessaryDefer:" - + exclude-dirs: + - internal/library/hggen/internal + exclude-files: [] + # https://golangci-lint.run/usage/linters linters-settings: @@ -176,7 +180,7 @@ linters-settings: # Select the Go version to target. # Default: 1.13 # Deprecated: use the global `run.go` instead. - go: "1.15" + # go: "1.15" # Sxxxx checks in https://staticcheck.io/docs/configuration/options/#checks # Default: ["*"] checks: [ @@ -187,7 +191,9 @@ linters-settings: govet: # Report about shadowed variables. # Default: false - check-shadowing: true + # check-shadowing: true + enable: + - shadow # Settings per analyzer. settings: # Analyzer name, run `go tool vet help` to see all analyzers. @@ -263,7 +269,7 @@ linters-settings: # Select the Go version to target. # Default: "1.13" # Deprecated: use the global `run.go` instead. - go: "1.15" + # go: "1.15" # SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks # Default: ["*"] checks: [ "all","-SA1019","-SA4015","-SA1029","-SA1016","-SA9003","-SA4006","-SA6003" ]