diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7d93b98f9..4b55e86af 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,10 +21,9 @@ jobs: fetch-depth: '0' - name: Golangci lint - uses: golangci/golangci-lint-action@051d91933864810ecd5e2ea2cfd98f6a5bca5347 + uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd with: - version: v1.62 - args: --verbose --timeout=10m + version: v2.0 - name: Markdown lint uses: docker://avtodev/markdown-lint:v1@sha256:6aeedc2f49138ce7a1cd0adffc1b1c0321b841dc2102408967d9301c031949ee diff --git a/.golangci.yml b/.golangci.yml index 877253d2c..784906cce 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,37 +1,57 @@ +version: "2" run: - deadline: 3m modules-download-mode: readonly - -linters-settings: - gocyclo: - min-complexity: 100 - gci: - sections: - - standard - - default - - prefix(d7y.io/api) - - prefix(d7y.io/dragonfly/v2) - +linters: + default: none + enable: + - errcheck + - goconst + - gocyclo + - govet + - misspell + - staticcheck + settings: + gocyclo: + min-complexity: 100 + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + - linters: + - staticcheck + text: 'SA1019:' + paths: + - third_party$ + - builtin$ + - examples$ issues: new: true - exclude-rules: - - linters: - - staticcheck - text: "SA1019:" - -linters: - disable-all: true +formatters: enable: - gci - gofmt - - misspell - - govet - - goconst - - gocyclo - - staticcheck - - errcheck + settings: + gci: + sections: + - standard + - default + - prefix(d7y.io/api) + - prefix(d7y.io/dragonfly/v2) + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ output: - format: colored-line-number - print-issued-lines: true - print-linter-name: true + formats: + text: + path: stdout + print-linter-name: true + print-issued-lines: true + colors: true