Skip to content

Commit

Permalink
ci: add golangci lint config
Browse files Browse the repository at this point in the history
  • Loading branch information
zoumo committed Dec 11, 2020
1 parent 9aa1cab commit 7afbcc7
Showing 1 changed file with 95 additions and 0 deletions.
95 changes: 95 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
linters-settings:
govet:
check-shadowing: true
golint:
min-confidence: 0
gocyclo:
min-complexity: 15
maligned:
suggest-new: true
dupl:
threshold: 100
misspell:
locale: US
lll:
line-length: 140
goimports:
local-prefixes: github.com/zoumo
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport # https://github.com/go-critic/go-critic/issues/845
- ifElseChain
- octalLiteral
- wrapperFunc
funlen:
lines: 100
statements: 50
linters:
disable-all: true
enable:
## for bug
- bodyclose
- errcheck
- govet
- ineffassign
- scopelint
- staticcheck
- typecheck

## for complexity
# - gocyclo
- nakedret
- gosimple

## for format
- gofmt
- goimports

## for style
- unconvert
- goconst
- misspell
- unparam
- golint
- whitespace
# - goerr113

## for unsed
- deadcode
- unused
- unparam
- varcheck
- structcheck

run:
deadline: 5m
# default is true. Enables skipping of directories:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs-use-default: true

issues:
exclude-use-default: true
exclude-rules:
- path: _test.go
linters:
- errcheck
- unparam
- gocyclo
- dupl
- gosec
- golint

# enable shadow declaration for err
- linters:
- govet
text: declaration of "err" shadows declaration at line

# - linters:
# - govet
# text: composite literal uses unkeyed fields

0 comments on commit 7afbcc7

Please sign in to comment.