diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab605c6..b47e968 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: - name: Lint code with golangci-lint uses: golangci/golangci-lint-action@v6 with: - version: v1.50.1 + version: v1.62.2 only-new-issues: true tests: name: Tests diff --git a/.golangci.yml b/.golangci.yml index 27d773f..96b3d2e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,31 +1,16 @@ run: skip-dirs-use-default: true allow-parallel-runners: true + modules-download-mode: readonly output: - format: colored-line-number + formats: + - format: colored-line-number sort-results: true -# Linters below do not support go1.18 yet because of generics. -# See https://github.com/golangci/golangci-lint/issues/2649 -# - bodyclose -# - sqlclosecheck - linters: disable-all: true enable: - - paralleltest - - tparallel - - asciicheck - - asasalint - - varnamelen - - reassign - - nilnil - - nilerr - - nakedret - - goprintffuncname - - typecheck - - errchkjson - errcheck - gosimple - govet @@ -33,11 +18,12 @@ linters: - staticcheck - unused - unparam + - bodyclose - dogsled - dupl - errorlint - exhaustive - - exportloopref + - copyloopvar - funlen - gocognit - goconst @@ -46,6 +32,7 @@ linters: - godot - goimports - revive + - mnd - gosec - lll - makezero @@ -53,9 +40,11 @@ linters: - nestif - prealloc - predeclared - - exportloopref + - sqlclosecheck - unconvert - whitespace + - unused + - testifylint linters-settings: govet: @@ -64,11 +53,9 @@ linters-settings: enable: - assign - atomic - - atomicalign - bools - buildtag - copylocks - - fieldalignment - httpresponse - loopclosure - lostcancel @@ -80,6 +67,7 @@ linters-settings: - unmarshal - unreachable - unsafeptr + - unused settings: printf: funcs: @@ -138,8 +126,8 @@ linters-settings: threshold: 200 errorlint: errorf: true - asserts: false - comparison: false + asserts: true + comparison: true exhaustive: check-generated: false default-signifies-exhaustive: false @@ -161,25 +149,23 @@ linters-settings: whitespace: multi-if: false multi-func: false - varnamelen: - max-distance: 10 - ignore-map-index-ok: true - ignore-type-assert-ok: true - ignore-chan-recv-ok: true - ignore-decls: - - t *testing.T - - e error - - i int + issues: exclude-rules: - path: _test\.go linters: + - dupl + - mnd - lll + - bodyclose - errcheck + - sqlclosecheck - misspell - ineffassign - whitespace - makezero + - maligned + - ifshort - errcheck - funlen - goconst @@ -187,8 +173,6 @@ issues: - gocyclo - godot - unused - - errchkjson - - varnamelen exclude-use-default: true exclude-case-sensitive: false max-issues-per-linter: 0 @@ -200,4 +184,4 @@ severity: case-sensitive: false service: - golangci-lint-version: 1.50.x + golangci-lint-version: 1.62.x \ No newline at end of file