diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 3db155945f..fd7a604c45 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v3 - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version version: latest @@ -33,7 +33,6 @@ jobs: # working-directory: somedir # Optional: golangci-lint command line arguments. - args: --timeout 10m0s # Optional: show only new issues if it's a pull request. The default value is `false`. only-new-issues: true diff --git a/.golang-ci.yaml b/.golang-ci.yaml deleted file mode 100644 index 48a26f05e7..0000000000 --- a/.golang-ci.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# Documentation: https://golangci-lint.run/usage/configuration/ -linters-settings: -linters: - enable: - - bodyclose - - containedctx - - decorder - - depguard - - dogsled - - dupl - - dupword - - errcheck - - errchkjson - - errname - - errorlint - - exhaustive - - goconst - - gocritic - - gofmt - - goimports - - gomodguard - - gosec - - gosimple - - govet - - ireturn - - maintidx - - makezero - - misspell - - musttag - - nakedret - - nilerr - - nilnil - - noctx - - nolintlint - - nosprintfhostport - - revive - - staticheck - - thelper - - typecheck - - unconvert - - unparam - - unused - - usestdlibvars - - whitespace - - wrapcheck - # Enabling presets means that new linters that we automatically adopt new - # linters that augment a preset. This also opts us in for replacement linters - # when a linter is deprecated. - presets: - - bugs - - comment - - complexity - - error - - format - - import - - metalinter - - module - - performance - - sql - - style - - test - - unused -output: - uniq-by-line: false -issues: - # Only flag new issues - new: true - exclude-rules: - - path: _test\.go - linters: - - errcheck - - gosec - max-issues-per-linter: 0 - max-same-issues: 0 - include: - # Enable off-by-default rules for revive requiring that all exported elements have a properly formatted comment. - - EXC0012 # https://golangci-lint.run/usage/false-positives/#exc0012 - - EXC0014 # https://golangci-lint.run/usage/false-positives/#exc0014 -run: - issues-exit-code: 1 - build-tags: - - e2e - skip-dirs: - - vendor - timeout: 20m - modules-download-mode: vendor diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 0000000000..9b572e6fc3 --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,68 @@ +# Documentation: https://golangci-lint.run/usage/configuration/ +linters: + disable-all: true + enable: + - bodyclose + - containedctx + - decorder + - depguard + - dogsled + - dupl + - dupword + - errcheck + - errchkjson + - errname + - errorlint + - exhaustive + - goconst + - gocritic + - gofmt + - goimports + - gomodguard + - gosec + - gosimple + - govet + - ireturn + - maintidx + - makezero + - misspell + - musttag + - nakedret + - nilerr + - nilnil + - noctx + - nolintlint + - nosprintfhostport + - revive + - staticcheck + - thelper + - typecheck + - unconvert + - unparam + - unused + - usestdlibvars + - whitespace +output: + uniq-by-line: false +issues: + # Only flag new issues + new: true + exclude-rules: + - path: _test\.go + linters: + - errcheck + - gosec + max-issues-per-linter: 0 + max-same-issues: 0 + include: + # Enable off-by-default rules for revive requiring that all exported elements have a properly formatted comment. + - EXC0012 # https://golangci-lint.run/usage/false-positives/#exc0012 + - EXC0014 # https://golangci-lint.run/usage/false-positives/#exc0014 +run: + issues-exit-code: 1 + build-tags: + - e2e + # skip-dirs: + # - vendor + timeout: 20m + modules-download-mode: vendor