Skip to content

Commit

Permalink
Adds golint config and ci step
Browse files Browse the repository at this point in the history
  • Loading branch information
ksysoev committed Oct 15, 2023
1 parent 90b6886 commit 6319731
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.19.x', '1.20.x', '1.21.x']
go-version: ['1.21.x']
steps:
- uses: actions/checkout@v3
- name: Setup Go ${{ matrix.go-version }}
Expand All @@ -16,6 +16,10 @@ jobs:
go-version: ${{ matrix.go-version }}
- name: Display Go version
run: go version
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
- name: Build
run: go build -v ./...
- name: Test
Expand Down
62 changes: 62 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
linters-settings:
errcheck:
check-type-assertions: true
goconst:
min-len: 2
min-occurrences: 3
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
govet:
check-shadowing: true
enable:
- fieldalignment
nolintlint:
require-explanation: true
require-specific: true

linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- errcheck
- exportloopref
- exhaustive
- goconst
- gocritic
- gofmt
- goimports
- gomnd
- gocyclo
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nolintlint
- nakedret
- prealloc
- predeclared
- revive
- staticcheck
- structcheck
- stylecheck
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- varcheck
- whitespace
- wsl

run:
issues-exit-code: 1
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
test:
go test -v --race ./...
go test -v --race ./...

lint:
golangci-lint run

0 comments on commit 6319731

Please sign in to comment.