-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yaml
71 lines (67 loc) · 2.97 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
70
71
# options for analysis running
run:
deadline: 60s
tests: true
skip-files:
silent: true
# output configuration options
output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true
# all available settings of specific linters
linters-settings:
errcheck:
check-type-assertions: true
check-blank: true
govet:
check-shadowing: true
gofmt:
simplify: true
goconst:
min-len: 3
min-occurrences: 3
misspell:
locale: UK
unused:
check-exported: false
unparam:
algo: cha
lll:
line-length: 150
tab-width: 1
exclude: ".*go:generate.*"
nakedret:
max-func-lines: 30
prealloc:
simple: true
range-loops: true
for-loops: true
linters:
enable:
- golint # Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes [fast: true]
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports [fast: true]
- misspell # Finds commonly misspelled English words in comments [fast: true]
- nakedret # Finds naked returns in functions greater than a specified function length [fast: true]
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks [fast: false]
- unused # Checks Go code for unused constants, variables, functions and types [fast: false]
- gas # Inspects source code for security problems [fast: false]
- structcheck # Finds an unused struct fields [fast: false]
- interfacer # Linter that suggests narrower interface types [fast: false]
- unconvert # Remove unnecessary type conversions [fast: false]
- unparam # Reports unused function parameters [fast: false]
- prealloc # Finds slice declarations that could potentially be preallocated [fast: true]
- gocyclo # Computes and checks the cyclomatic complexity of functions [fast: true]
- deadcode # Finds unused code [fast: false]
- gosimple # Linter for Go source code that specializes in simplifying a code [fast: false]
- goconst # Finds repeated strings that could be replaced by a constant [fast: true]
disable:
- lll # Reports long lines [fast: true]
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true]
- dupl # Tool for code clone detection [fast: true]
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code [fast: false]
- depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: false]
- varcheck # Finds unused global variables and constants [fast: false]
- maligned # Tool to detect Go structs that would take less memory if their fields were sorted [fast: false]
- megacheck # 3 sub-linters in one: unused, gosimple and staticcheck [fast: false]
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases [fast: false]