From a47865ede9fcbd837c23b5718470949ec9dc769a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gonz=C3=A1lez=20Di=20Antonio?= Date: Sat, 24 Oct 2026 19:08:00 +0200 Subject: [PATCH] ci: lint in the pull request workflow .golangci.yaml enabled errcheck, ineffassign, staticcheck and unused, and nothing ran them: the pull request workflow built, tested and measured coverage only. A lint step now runs golangci-lint with that file, pinned to v2.15.0 as the coverage tool is pinned: the job builds with the Go of go.mod (1.26, GOTOOLCHAIN=local), and v2.15.0 is the newest release whose go directive (1.26.0) that Go installs. The step's pipe fails the job on a finding (the workflow's shell is bash with pipefail). Co-Authored-By: Claude Opus 5.5 --- .github/workflows/pr.yaml | 14 ++++++++++++++ DEVELOPMENT_GUIDELINES.md | 1 + 2 files changed, 15 insertions(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 12cf21c..a01f85b 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -87,6 +87,20 @@ jobs: scc --format html-table . | tee -a $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY + - name: lint + run: | + echo "## Lint" >> $GITHUB_STEP_SUMMARY + + # Pinned, as the coverage tool is: this module builds with the Go + # of its go.mod (1.26, GOTOOLCHAIN=local), and a golangci-lint + # whose go directive is newer does not install. v2.15.0 declares + # go 1.26.0. Raise it with the go directive. The linters it runs + # are .golangci.yaml's. + go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.15.0 + + golangci-lint run ./... | tee -a $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + - name: test run: | echo "### Test report" >> $GITHUB_STEP_SUMMARY diff --git a/DEVELOPMENT_GUIDELINES.md b/DEVELOPMENT_GUIDELINES.md index a021bee..0f15e31 100644 --- a/DEVELOPMENT_GUIDELINES.md +++ b/DEVELOPMENT_GUIDELINES.md @@ -8,6 +8,7 @@ Follows these guidelines precisely to ensure consistency and maintainability of - Language: Go (Go 1.22+) - Framework: Go standard library - Testing: Go's built-in testing package +- Lint: golangci-lint, with the linters `.golangci.yaml` enables, in the pull request workflow - Dependency Management: Go modules - Version Control: Git - Documentation: go doc