From f4013d4a3ad4ccd12e29bd2fe78350dc6a871c1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Jir=C3=A9nius?= Date: Mon, 10 Jun 2024 10:37:37 +0200 Subject: [PATCH] GH-245: Added staticcheck to go.yml checks. --- .github/workflows/go.yml | 10 +++++++--- scripts/check.sh | 4 ++-- scripts/install-checks.sh | 7 ++----- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 9e04f1a..a109f06 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -54,6 +54,10 @@ jobs: uses: actions/setup-go@v5 with: go-version: '1.22.4' + - name: Install checks + run: | + go install honnef.co/go/tools/cmd/staticcheck@latest + go install github.com/client9/misspell/cmd/misspell@latest - name: Go get run: go get -t ./... - name: Go Vet @@ -62,7 +66,7 @@ jobs: run: go mod tidy; git diff --exit-code go.mod go.sum - name: Go FMT run: go fmt $(go list ./... | grep -v /vendor/); git diff --exit-code + - name: Staticcheck + run: staticcheck -checks all,-ST1000 ./... - name: Misspell - run: | - go install github.com/client9/misspell/cmd/misspell@latest - misspell -error -locale US . + run: misspell -error -locale US . diff --git a/scripts/check.sh b/scripts/check.sh index ca183ef..2013354 100755 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -9,6 +9,6 @@ fi echo "Checking with go vet..." go vet ./... echo "Checking with staticcheck..." -staticcheck ./... +staticcheck -checks all,-ST1000 ./... echo "Checking with misspell..." -misspell -error -locale US . +misspell -error -locale US *.* docs examples/*/*.* logger nats scripts server test diff --git a/scripts/install-checks.sh b/scripts/install-checks.sh index 092e264..7710f08 100755 --- a/scripts/install-checks.sh +++ b/scripts/install-checks.sh @@ -1,7 +1,4 @@ #!/bin/bash -e -pushd /tmp > /dev/null -go get -u github.com/mattn/goveralls -go get -u honnef.co/go/tools/cmd/staticcheck -go get -u github.com/client9/misspell/cmd/misspell -popd > /dev/null +go install honnef.co/go/tools/cmd/staticcheck@latest +go install github.com/client9/misspell/cmd/misspell@latest