-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path.golangci.yml
More file actions
93 lines (86 loc) · 2.14 KB
/
Copy path.golangci.yml
File metadata and controls
93 lines (86 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
version: "2"
run:
concurrency: 4
timeout: 5m
issues-exit-code: 1
tests: true
linters:
disable-all: true
exclusions:
rules:
- path: _test\.go
linters:
- goconst
enable:
## Core
- errcheck # unchecked errors
- govet # vet
- ineffassign # useless assignments
- staticcheck # comprehensive checks
- unused # unused code
## Style & Formatting
- revive # stylistic/idiomatic checks (better golint)
- whitespace # redundant whitespace
- misspell # typos
- lll # line length
- funlen # function length
## Complexity & Quality
- gocyclo # cyclomatic complexity
- gocognit # cognitive complexity
- goconst # repeated strings
- dogsled # too many blank identifiers
- nakedret # naked returns in long functions
- unconvert # unnecessary conversions
## Bugs & Performance
- bodyclose # http body close
- gosec # security checks
- nilerr # returning nil error
- noctx # sending http request without context
- prealloc # slice pre-allocation
- usestdlibvars # use standard library constants
- gocritic # opinionated checks
linters-settings:
gocyclo:
min-complexity: 15
gocognit:
min-complexity: 30
gofmt:
simplify: true
ll:
line-length: 120
misspell:
locale: US
funlen:
lines: 100
statements: 50
revive:
rules:
- name: exported
severity: warning
- name: package-comments
severity: warning
- name: context-as-argument
- name: context-keys-type
- name: error-naming
- name: error-strings
- name: error-return
- name: if-return
- name: increment-decrement
- name: var-naming
- name: var-declaration
- name: receiver-naming
gocritic:
enabled-tags:
- diagnostic
- style
- performance
disabled-checks:
- hugeParam
- ifElseChain
issues:
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0
exclude-dirs:
- bin
- vendor