Skip to content

Commit

Permalink
rename golangci-lint config file and use golangci-lint-action to lint
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <[email protected]>
  • Loading branch information
mmorel-35 committed Apr 18, 2024
1 parent f04fbbc commit a0c1431
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/pr-linter-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions golangci.yaml → .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ linters-settings:
- expected-actual
- go-require
- float-compare
- nil-compare
- require-error
- suite-dont-use-pkg
- suite-extra-assert-call
Expand Down
2 changes: 1 addition & 1 deletion hack/build-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hack/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a0c1431

Please sign in to comment.