1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 11:31:46 +00:00

feat: add golangci-lint for Go code quality

- Add .golangci.yml configuration enabling govet, staticcheck, errcheck, gosimple, ineffassign, unused, gofmt, and goimports linters
- Update scripts/check.sh to run golangci-lint with go vet fallback
- Update CI workflow to install golangci-lint in both format and quality jobs
- Add golangci-lint to CONTRIBUTING.md setup instructions

Closes #266
This commit is contained in:
Matt Kneale
2026-01-08 14:28:03 +08:00
committed by Tw93
parent 9a3ecb7377
commit 0cc205209c
4 changed files with 93 additions and 10 deletions

View File

@@ -27,12 +27,13 @@ jobs:
~/Library/Caches/Homebrew
/usr/local/Cellar/shfmt
/usr/local/Cellar/shellcheck
key: ${{ runner.os }}-brew-quality-${{ hashFiles('**/Brewfile') }}
/usr/local/Cellar/golangci-lint
key: ${{ runner.os }}-brew-quality-v2-${{ hashFiles('**/Brewfile') }}
restore-keys: |
${{ runner.os }}-brew-quality-
${{ runner.os }}-brew-quality-v2-
- name: Install tools
run: brew install shfmt shellcheck
run: brew install shfmt shellcheck golangci-lint
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v5
@@ -75,12 +76,18 @@ jobs:
~/Library/Caches/Homebrew
/usr/local/Cellar/shfmt
/usr/local/Cellar/shellcheck
key: ${{ runner.os }}-brew-quality-${{ hashFiles('**/Brewfile') }}
/usr/local/Cellar/golangci-lint
key: ${{ runner.os }}-brew-quality-v2-${{ hashFiles('**/Brewfile') }}
restore-keys: |
${{ runner.os }}-brew-quality-
${{ runner.os }}-brew-quality-v2-
- name: Install tools
run: brew install shfmt shellcheck
run: brew install shfmt shellcheck golangci-lint
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v5
with:
go-version: '1.24.6'
- name: Run check script
run: ./scripts/check.sh --no-format