mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 12:41: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:
19
.github/workflows/check.yml
vendored
19
.github/workflows/check.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user