Merge pull request #1829 from mmorel-35/golangci-lint@v2

[chore]: bump golangci-lint to v2.1.1
pull/1840/head
shirou 4 weeks ago committed by GitHub
commit 7d9af6fd99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -69,7 +69,7 @@ jobs:
with: with:
go-version-file: go.mod go-version-file: go.mod
- name: Setup golangci-lint - name: Setup golangci-lint
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2 uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
with: with:
args: --verbose args: --verbose
version: latest version: latest

@ -1,20 +1,25 @@
version: "2"
formatters:
enable:
- gci
- gofumpt
settings:
gci:
sections:
- standard
- default
- prefix(github.com/shirou)
issues: issues:
max-same-issues: 0 max-same-issues: 0
exclude-rules: []
linters: linters:
enable: enable:
- asciicheck - asciicheck
- contextcheck - contextcheck
- durationcheck - durationcheck
- errorlint - errorlint
- gci
- gocritic - gocritic
- gofmt
- gofumpt
- goimports
- gomodguard - gomodguard
- gosec - gosec
- gosimple
- importas - importas
- misspell - misspell
- nakedret - nakedret
@ -24,7 +29,6 @@ linters:
- revive - revive
- testifylint - testifylint
- thelper - thelper
- typecheck
- unparam - unparam
- usetesting - usetesting
disable: disable:
@ -33,83 +37,88 @@ linters:
- ineffassign - ineffassign
- staticcheck - staticcheck
- unused - unused
linters-settings: settings:
gci: gocritic:
sections: disabled-checks:
- standard - captLocal
- default gomodguard:
- prefix(github.com/shirou) blocked:
gocritic: modules:
disabled-checks: - io/ioutil:
- captLocal recommendations:
gomodguard: - io
blocked: - os
modules: gosec:
- io/ioutil: excludes:
recommendations: - G115
- io perfsprint:
- os # Optimizes even if it requires an int or uint type cast.
gosec: int-conversion: true
excludes: # Optimizes into `err.Error()` even if it is only equivalent for non-nil errors.
- G115 err-error: true
perfsprint: # Optimizes `fmt.Errorf`.
# Optimizes even if it requires an int or uint type cast. errorf: true
int-conversion: true # Optimizes `fmt.Sprintf` with only one argument.
# Optimizes into `err.Error()` even if it is only equivalent for non-nil errors. sprintf1: true
err-error: true # Optimizes into strings concatenation.
# Optimizes `fmt.Errorf`. strconcat: true
errorf: true revive:
# Optimizes `fmt.Sprintf` with only one argument. rules:
sprintf1: true - name: blank-imports
# Optimizes into strings concatenation. - name: context-as-argument
strconcat: true arguments:
revive: - allowTypesBefore: "*testing.T"
rules: - name: context-keys-type
- name: blank-imports - name: dot-imports
- name: context-as-argument - name: duplicated-imports
arguments: - name: early-return
- allowTypesBefore: "*testing.T" arguments:
- name: context-keys-type - "preserveScope"
- name: dot-imports - name: empty-block
- name: duplicated-imports disabled: true
- name: early-return - name: error-naming
arguments: - name: error-return
- "preserveScope" - name: error-strings
- name: empty-block - name: exported
disabled: true disabled: true
- name: error-naming - name: errorf
- name: error-return - name: increment-decrement
- name: error-strings - name: indent-error-flow
- name: exported arguments:
disabled: true - "preserveScope"
- name: errorf - name: range
- name: increment-decrement - name: receiver-naming
- name: indent-error-flow - name: redefines-builtin-id
arguments: - name: redundant-import-alias
- "preserveScope" - name: superfluous-else
- name: range arguments:
- name: receiver-naming - "preserveScope"
- name: redefines-builtin-id - name: time-naming
- name: redundant-import-alias - name: unexported-return
- name: superfluous-else - name: unnecessary-stmt
arguments: - name: unreachable-code
- "preserveScope" - name: unused-parameter
- name: time-naming - name: use-any
- name: unexported-return - name: var-declaration
- name: unnecessary-stmt - name: var-naming
- name: unreachable-code arguments:
- name: unused-parameter - ["ID"] # AllowList
- name: use-any - ["VM"] # DenyList
- name: var-declaration - - upperCaseConst: true # Extra parameter (upperCaseConst|skipPackageNameChecks)
- name: var-naming testifylint:
arguments: enable-all: true
- ["ID"] # AllowList usetesting:
- ["VM"] # DenyList
- - upperCaseConst: true # Extra parameter (upperCaseConst|skipPackageNameChecks)
testifylint:
enable-all: true
usetesting:
os-create-temp: false os-create-temp: false
os-mkdir-temp: false os-mkdir-temp: false
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
warn-unused: true
output:
show-stats: false
run: run:
timeout: 5m timeout: 5m

@ -554,7 +554,7 @@ func TestOpenFiles(t *testing.T) {
assert.NotEmpty(t, v) // test always open files. assert.NotEmpty(t, v) // test always open files.
for _, vv := range v { for _, vv := range v {
assert.NotEqual(t, "", vv.Path) assert.NotEmpty(t, vv.Path)
} }
} }

Loading…
Cancel
Save