diff --git a/.github/workflows/pr-linter-check.yml b/.github/workflows/pr-linter-check.yml index f2dc7c6e6c..c64904920e 100644 --- a/.github/workflows/pr-linter-check.yml +++ b/.github/workflows/pr-linter-check.yml @@ -8,7 +8,15 @@ jobs: steps: - name: Check out the code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + cache: false - name: Linter check - run: make lint + uses: golangci/golangci-lint-action@v4 + with: + version: v1.57.2 + args: --verbose diff --git a/golangci.yaml b/.golangci.yaml similarity index 99% rename from golangci.yaml rename to .golangci.yaml index c96c7428e0..82eddb95e8 100644 --- a/golangci.yaml +++ b/.golangci.yaml @@ -253,6 +253,7 @@ linters-settings: - expected-actual - go-require - float-compare + - nil-compare - require-error - suite-dont-use-pkg - suite-extra-assert-call diff --git a/hack/build-image/Dockerfile b/hack/build-image/Dockerfile index 161a837f0b..e2d966f73a 100644 --- a/hack/build-image/Dockerfile +++ b/hack/build-image/Dockerfile @@ -93,7 +93,7 @@ RUN ARCH=$(go env GOARCH) && \ chmod +x /usr/bin/goreleaser # get golangci-lint -RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.0 +RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.57.2 # install kubectl RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/$(go env GOARCH)/kubectl diff --git a/hack/lint.sh b/hack/lint.sh index 13ed64caba..4cb686d4bf 100755 --- a/hack/lint.sh +++ b/hack/lint.sh @@ -21,7 +21,7 @@ golangci-lint cache status # Enable GL_DEBUG line below for debug messages for golangci-lint # export GL_DEBUG=loader,gocritic,env -CMD="golangci-lint run -c $HACK_DIR/../golangci.yaml" +CMD="golangci-lint run -c $HACK_DIR/../.golangci.yaml" echo "Running $CMD" eval $CMD