-
Notifications
You must be signed in to change notification settings - Fork 5
/
.golangci.yml
81 lines (77 loc) · 2.47 KB
/
.golangci.yml
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
linters:
enable-all: true
disable:
# First, disable deprecated linters
- interfacer
- golint
- scopelint
# We use long functions
- cyclop
# We have some utility unused functions
- deadcode
# Reports false positives
- dupl
# We don't need to initialize every value of a struct
- exhaustivestruct
# We use print statements
- forbidigo
# We do not need to check every type assertion
- forcetypeassert
# We use long functions
- funlen
# We use globals in the code base
- gochecknoglobals
# gocognit complains about having large functions
- gocognit
# goconst complains about common strings
- goconst
# gocritic complains about needing to make case statements
- gocritic
# gocyclo complains about having large functions
- gocyclo
# We do not use conventional Golang comments
- godot
# goerr113 complains about creating new static errors
- goerr113
# gofumpt is not used
- gofumpt
# gomnd complains about magic numbers
- gomnd
# We declare variables at the beginning of a function for consistency
- ifshort
# We manage long lines manually
- lll
# We do not care about making structs take less memory
- maligned
# nestif complains about some harmless nested if statements
- nestif
# nlreturn requires about excessive newlines around return statements
- nlreturn
# We do not need to use contexts in certain situations
- noctx
# TODO
- nosnakecase
# We use some unused parameters for command function uniformity
- unparam
# We have some utility unused functions
- unused
# We don't need to wrap all errors
- wrapcheck
# WSL requires excessive newlines around if statements
- wsl
issues:
# We want to use golint but we don't care about some of the things that it complains about
exclude:
# We have many exported functions without comments
- "exported \\w+ (\\S*['.]*)([a-zA-Z'.*]*) should have comment or be unexported"
# We block-scope variables in many places, making it impossible to outdent
- "if block ends with a return statement, so drop this else and outdent its block"
# TODO in comments is okay
- "Line contains TODO/BUG/FIXME"
linters-settings:
govet:
# Checking for shadowed variables is experimental and disabled by default
check-shadowing: true
whitespace:
# Enforce newlines (or comments) after every multi-line if statement
multi-if: true