Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.golangci: init #500

Open
wants to merge 1 commit into
base: v3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ _testmain.go
*.prof

.idea
.vscode
bin
.DS_Store
coverage.txt

Expand Down
58 changes: 58 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
run:
modules-download-mode: readonly
issues-exit-code: 0
timeout: 5m

linters:
enable-all: true
disable:
# TODO: enable one by one
- goconst
- nilerr
- maintidx
- whitespace
- prealloc
- godox
- gocyclo
- ifshort
- wastedassign
- gofumpt
- lll
- nestif
- errchkjson
- exportloopref
- errorlint
- gosimple
- tenv
- ineffassign
- gocritic
- gocognit
- ireturn
- forbidigo
- containedctx
- tagliatelle
- cyclop
- errcheck
- exhaustivestruct
- forcetypeassert
- funlen
- gochecknoglobals
- gochecknoinits
- goerr113
- godot
- gomnd
- gosec
- revive
- varnamelen
- wrapcheck
- noctx
- staticcheck
- stylecheck
- paralleltest
- golint
- interfacer
- maligned
- nlreturn
- scopelint
- testpackage
- wsl
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
linter:
./bin/golangci-lint run ./...
.PHONY: linter

linter.download:
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh
.PHONY: linter.download

test:
env CGO_ENABLED=1 go test -race ./...
.PHONY: test

alltest: linter test
.PHONY: alltest