diff --git a/.golangci.yml b/.golangci.yml index 3438e8e08..f8cbb79a9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,50 +1,57 @@ -# Refer to golangci-lint's example config file for more options and information: -# https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml +# golangci-lint v2 configuration. +# https://golangci-lint.run/docs/configuration/file/ -version: 2 +version: "2" run: timeout: 5m - modules-download-mode: readonly linters: enable: - errcheck - errname - govet + - ineffassign - prealloc - predeclared - revive - staticcheck - unused + + settings: + revive: + # Named rules, not the whole set: these are conventions Go itself + # has an opinion about. Rules that report a threshold are left out. + rules: + - name: error-naming + - name: error-return + - name: error-strings + - name: errorf + - name: exported + - name: increment-decrement + - name: indent-error-flow + - name: range + - name: receiver-naming + - name: superfluous-else + - name: time-naming + - name: unused-parameter + - name: var-naming + exclusions: paths: - - ui/node_modules - rules: - - linters: - - revive - path: internal/api/ - text: "var-naming: avoid meaningless package names" - - linters: - - revive - path: internal/exec/ - text: "var-naming: avoid package names that conflict with Go standard library package names" - - linters: - - revive - path: internal/api/metrics/ - text: "var-naming: avoid package names that conflict with Go standard library package names" + # Go shipped inside a JS package. Not ours, and not tracked in git. + - node_modules + presets: + - comments + - std-error-handling formatters: enable: + - gofmt - goimports -linters-settings: - revive: - enable-all-rules: true - issues: - exclude-use-default: false + # Defaults truncate: 50 findings per linter, and one per line. max-issues-per-linter: 0 max-same-issues: 0 - exclude-dirs: - - ./client + uniq-by-line: false