diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01bf744..83daba5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: - name: Lint code with golangci-lint uses: golangci/golangci-lint-action@v3 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 0a739bc..fa9e330 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,20 +126,18 @@ linters-settings: threshold: 200 errorlint: errorf: true - asserts: false - comparison: false exhaustive: check-generated: false default-signifies-exhaustive: false funlen: - lines: 90 - statements: 40 + lines: 65 + statements: 50 gocognit: min-complexity: 25 gocyclo: min-complexity: 25 goimports: - local-prefixes: github.com/retailcrm/messenger + local-prefixes: github.com/retailcrm/mg-transport-api-client-go lll: line-length: 120 misspell: @@ -161,25 +147,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,10 +171,6 @@ issues: - gocyclo - godot - unused - - errchkjson - - varnamelen - - path: \.go - text: "Error return value of `io.WriteString` is not checked" exclude-use-default: true exclude-case-sensitive: false max-issues-per-linter: 0 @@ -202,4 +182,4 @@ severity: case-sensitive: false service: - golangci-lint-version: 1.50.x + golangci-lint-version: 1.62.x \ No newline at end of file