diff --git a/.golangci.yaml b/.golangci.yaml index 165ffe3770..fb21e0a629 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -9,8 +9,9 @@ run: - ^scripts - ^terraform - ^upi - go: '1.19' + go: '1.20' modules-download-mode: vendor + allow-parallel-runners: true output: print-linter-name: true sort-results: true @@ -20,7 +21,6 @@ linters: - asciicheck - containedctx - decorder - - depguard - dogsled - errcheck - errorlint @@ -128,7 +128,37 @@ linters-settings: # It's a comma-separated list of prefixes. # Default: "" local-prefixes: github.com/openshift + revive: + rules: + # The following rules are recommended https://github.com/mgechev/revive#recommended-configuration + - name: blank-imports + - name: context-as-argument + - name: context-keys-type + - name: dot-imports + - name: error-return + - name: error-strings + - name: error-naming + - name: exported + - name: if-return + - name: increment-decrement + - name: var-naming + - name: var-declaration + - name: range + - name: receiver-naming + - name: time-naming + - name: unexported-return + - name: indent-error-flow + - name: errorf + - name: superfluous-else + - name: unreachable-code + - name: redefines-builtin-id + - name: bool-literal-in-expr + - name: constant-logical-expr issues: include: - EXC0012 # EXC0012 revive: issue about not having a comment on exported. - EXC0014 # EXC0014 revive: issue about not having a comment in the right format. + exclude-rules: + - linters: + - goconst + path: _test\.go diff --git a/hack/go-lint.sh b/hack/go-lint.sh index b30ce62047..2109327025 100755 --- a/hack/go-lint.sh +++ b/hack/go-lint.sh @@ -6,4 +6,4 @@ podman run --rm \ --volume "${PWD}:/go/src/github.com/openshift/installer:z" \ --workdir /go/src/github.com/openshift/installer \ docker.io/golangci/golangci-lint:v1.53.1 \ - golangci-lint run "${@}" + golangci-lint run --new-from-rev=dcf8122 "${@}"