-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.golangci.yaml
69 lines (60 loc) · 1.89 KB
/
.golangci.yaml
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
# options for analysis running
run:
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 2m
issues:
# Only report issues for changes since master
new-from-rev: origin/master
# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
formats:
- format: colored-line-number
linters-settings:
errcheck:
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
check-type-assertions: true
# Function length check
funlen:
lines: 60
statements: 40
# Report deeply nested if statements
nestif:
# minimal complexity of if statements to report, 5 by default
min-complexity: 4
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
govet:
# report about shadowed variables
enable-all: true
disable:
# Do not check field memory alignment because in most cases the performance gain is not worth the headache
- fieldalignment
linters:
# Disable the default linters so we can explicitly name the linters we want
disable-all: true
# List of enabled linters
enable:
#####################
# Default linters
#####################
- gofmt
# Checks error handling
- errcheck
# Linter for Go source code that specializes in simplifying a code
- gosimple
# Vet examines Go source code and reports suspicious constructs, such as Printf calls whose
# arguments do not align with the format string
- govet
# Detects when assignments to existing variables are not used
- ineffassign
# Static code analytics
- staticcheck
# Reports unused function parameters.
- unparam
# Check if variables or functions are unused
- unused
# Remove unnecessary type conversions.
- unconvert