diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8804d7f6b..8a94673df 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,7 +18,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.52.0 + version: v1.55.2 golangci-examples: name: golangci-lint-examples concurrency: @@ -34,7 +34,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.52.0 + version: v1.55.2 working-directory: examples golangci-slo: name: golangci-lint-slo @@ -51,7 +51,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.52.0 + version: v1.55.2 working-directory: tests/slo autoformatter: name: autoformat check diff --git a/.golangci.yml b/.golangci.yml index efaf32e7e..c335db109 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,11 +1,5 @@ # options for analysis running run: - # default concurrency is a available CPU number - concurrency: 4 - - # timeout for analysis, e.g. 30s, 5m, default is 1m - deadline: 5m - # exit code when at least one issue was found, default is 1 issues-exit-code: 1 @@ -58,7 +52,6 @@ linters-settings: govet: # report about shadowed variables check-shadowing: true - fieldalignment: true golint: # minimal confidence for issues, default is 0.8 min-confidence: 0.8 @@ -76,9 +69,6 @@ linters-settings: min-len: 2 # minimal occurrences count to trigger, 3 by default min-occurrences: 2 - fieldalignment: - # print struct with more effective memory layout or not, false by default - suggest-new: true misspell: # Correct spellings using locale preferences for US or UK. # Default is to use a neutral variety of English. @@ -109,17 +99,7 @@ linters-settings: - name: empty-block - name: superfluous-else - name: unreachable-code - unused: - # treat code as a program (not a library) and report unused exported identifiers; default is false. - # XXX: if you enable this setting, unused will report a lot of false-positives in text editors: - # if it's called for subdir of a project it can't find funcs usages. All text editor integrations - # with golangci-lint call it on a directory with the changed file. - check-exported: false unparam: - # call graph construction algorithm (cha, rta). In general, use cha for libraries, - # and rta for programs with main packages. Default is cha. - algo: cha - # Inspect exported functions, default is false. Set to true if no external program/library imports your code. # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: # if it's called for subdir of a project it can't find external interfaces. All text editor integrations @@ -130,7 +110,7 @@ linters-settings: - whyNoLint # https://github.com/go-critic/go-critic/issues/1063 - importShadow - sloppyReassign -# - typeDefFirst + # - typeDefFirst # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks. # See https://github.com/go-critic/go-critic#usage -> section "Tags". # Default: [] @@ -225,66 +205,68 @@ linters-settings: # Default: false checkExported: true linters: - disable-all: true - enable: -# - cyclop + enable-all: true + disable: + - asasalint + - bodyclose + - containedctx + - contextcheck + - cyclop + - deadcode - depguard - - dogsled -# - dupl - - errcheck - - errorlint -# - exhaustive -# - exhaustivestruct -# - forbidigo -# - funlen -# - gci -# - gocognit + - dupl + - dupword + - durationcheck + - errname + - exhaustive + - exhaustivestruct + - exhaustruct + - forbidigo + - forcetypeassert + - funlen + - gci + - gochecknoglobals + - gochecknoinits + - gocognit - goconst - - gocritic - - gocyclo -# - godot - - godox - - gofmt # On why gofmt when goimports is enabled - https://github.com/golang/go/issues/21476 - - gofumpt - - goheader - - goimports -# - gomnd -# - gomoddirectives -# - gomodguard + - godot + - goerr113 + - golint + - gomnd + - gomoddirectives - gosec - - gosimple - - govet - - depguard -# - ifshort -# - ireturn - - lll - - makezero - - misspell - - ineffassign - - misspell + - ifshort + - inamedparam + - interfacebloat + - interfacer + - ireturn + - maintidx + - maligned - nakedret - - nestif -# - nilnil -# - nlreturn - - nolintlint - - prealloc - - predeclared - - rowserrcheck + - nilerr + - nilnil + - nlreturn + - noctx + - nonamedreturns + - nosnakecase + - paralleltest + - promlinter + - protogetter - revive - - staticcheck - - stylecheck -# - tagliatelle -# - testpackage -# - thelper -# - tenv - - typecheck - - unconvert - - unparam - - unused -# - varnamelen - - whitespace -# - wrapcheck -# - wsl + - scopelint + - sqlclosecheck + - structcheck + - tagalign + - tagliatelle + - testableexamples + - testifylint + - testpackage + - thelper + - varcheck + - varnamelen + - wastedassign + - wrapcheck + - wsl issues: # List of regexps of issue texts to exclude, empty list by default. @@ -309,9 +291,6 @@ issues: # Default value for this option is true. exclude-use-default: true - # Maximum issues count per one linter. Set to 0 to disable. Default is 50. - max-per-linter: 0 - # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. max-same-issues: 0 @@ -341,4 +320,4 @@ issues: linters: - staticcheck - path: _test\.go - text: "ydb.Connection is deprecated" + text: "ydb.Connection is deprecated" \ No newline at end of file