From 6448f4b9e270650e87a5914fb9be1479a2c2e0a0 Mon Sep 17 00:00:00 2001 From: Thomas Meckel Date: Sat, 12 Aug 2023 17:51:59 +0000 Subject: [PATCH 1/2] Now using golangci-lint-action and gopfumpt in .github/workflows/lint.yml Closes: #23 --- .github/workflows/lint.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 58f50236..711fa332 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -50,18 +50,20 @@ jobs: go mod verify go mod download - curl -fsSL https://github.com/golangci/golangci-lint/releases/download/v${LINT_VERSION}/golangci-lint-${LINT_VERSION}-linux-amd64.tar.gz | \ - tar xz --strip-components 1 --wildcards \*/golangci-lint - mkdir -p bin && mv golangci-lint bin/ - - name: Run Lint checks - run: | - bin/golangci-lint run --out-format=github-actions --timeout=3m || exit $? + uses: golangci/golangci-lint-action@v3 + with: + version: v${LINT_VERSION} + install-mode: binary - name: Build docs generator run: | go build -o bin/gen-docs cmd/gen-docs/gen-docs.go || exit $? + - name: Build gopfumpt + run: | + go install mvdan.cc/gofumpt@latest + - name: Run checks run: | STATUS=0 @@ -76,7 +78,7 @@ jobs: } assert-nothing-changed ./bin/gen-docs --doc-path ./docs --website - assert-nothing-changed go fmt ./... + assert-nothing-changed gofumpt -l -w . assert-nothing-changed go mod tidy exit $STATUS From c7a7f313112860976b3e1ccb4f39942e5d771d24 Mon Sep 17 00:00:00 2001 From: Thomas Meckel Date: Sat, 12 Aug 2023 17:55:14 +0000 Subject: [PATCH 2/2] Corrected version reference to golangci-lint in .github/workflows/lint.yml --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 711fa332..e6a0a292 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -53,7 +53,7 @@ jobs: - name: Run Lint checks uses: golangci/golangci-lint-action@v3 with: - version: v${LINT_VERSION} + version: v${{ env.LINT_VERSION }} install-mode: binary - name: Build docs generator