chore(golangci-lint): lint配置兼容性修复

This commit is contained in:
mh-swift 2024-07-09 17:07:05 +08:00
parent f78f44e00f
commit 491e6cef09

View File

@ -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" ]