Skip to content

Commit

Permalink
Add golangci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome committed Jul 19, 2024
1 parent 9a4cdc8 commit b860508
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 2 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,41 @@ on:
branches:
- master
pull_request:

name: CI
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.17', '1.18', '1.19', '1.20', '1.21', 'stable']
steps:
- name: Checkout code
- name: Checkout Repository
uses: actions/checkout@v4

- name: Init Hermit
run: ./bin/hermit env -r >> $GITHUB_ENV

- name: Setup Golang Environment
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Test
run: go test ./...
run: go test ./... -race -shuffle=on -v

lint:
name: Go Lint
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Golang Environment
uses: actions/setup-go@v5
with:
go-version: stable

- name: Lint Go
uses: golangci/golangci-lint-action@v6
56 changes: 56 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
linters-settings:
misspell:
locale: US
govet:
enable-all: true
linters:
enable:
- asasalint
- asciicheck
- bidichk
- contextcheck
- dupword
- durationcheck
- errchkjson
- errname
- exportloopref
- fatcontext
- gocheckcompilerdirectives
- gochecksumtype
- gocritic
- godot
- gofmt
- gofumpt
- goimports
- gosec
- gosimple
- gosmopolitan
- govet
- ineffassign
- makezero
- misspell
- musttag
- nilerr
- noctx
- nolintlint
- paralleltest
- prealloc
- predeclared
- reassign
- staticcheck
- tagalign
- tenv
- thelper
- tparallel
- typecheck
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace
disable-all: true
issues:
max-issues-per-linter: 0
max-same-issues: 0
run:
timeout: 5m

0 comments on commit b860508

Please sign in to comment.