-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.golangci.yml
59 lines (57 loc) · 2.21 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
run:
skip-dirs:
- doc
- docs
- .cache
linters-settings:
maligned:
suggest-new: true
gocritic:
disabled-checks:
- singleCaseSwitch
- ifElseChain # Don't advice "if-else to switch"
cyclop:
max-complexity: 30 # Set max cyclomatic complexity to 30
revive:
rules:
- name: var-naming # Don't check var naming or package naming
Disabled: true
stylecheck:
checks: ["all", "-ST1003"]
gomoddirectives:
replace-allow-list: # Allow current replace in go.mod
linters:
disable:
- forcetypeassert
- maintidx
- varnamelen
- gochecknoglobals
- funlen
- lll # Don't complain of line too long
- goerr113 # Don't check if error is dynamic. I disabled it here because it seems in many cases we just log err msg and we don't check error type.
- gochecknoinits # Don't complain of init() function
- forbidigo # Don't forbid using fmt.Printf/fmt.Println
- promlinter # Don't check Prometheus metrics naming
- exhaustive # Don't check exhaustiveness of enum switch statements
- exhaustivestruct # Don't check if all fields of a struct is initialized
- wsl # This linter force you to add/remove empty lines to improve readibility
- nlreturn # This linter force you to add new line before return/goto/break
- durationcheck # Don't complain of >2 durations multiply (e.g. time.Hour*24*rotationTime)
- gci # Don't use gci (a tool that control golang package import order and make it always deterministic) to check code
- gofumpt # Don't use gofumpt (a stricter version of gofmt) to check codes
- godot # Don't check if comments end in a period
- godox # Don't complain of comments contain "TODO/BUG/FIXME"
- gomnd # Don't complain of 'magic number'
- tagliatelle # Don't complain of struct tag style
- whitespace # Some of its advices will even hurt readability
- gocognit # Do not check congnitive complexity
- nestif # Do not check nested if
- scopelint # Deprecated linter
- maligned # Deprecated
- interfacer # Deprecated
- golint # Deprecated
- ireturn # Do not check the return object is interface
- gocyclo
- cyclop
- exhaustruct
enable-all: true