-
Notifications
You must be signed in to change notification settings - Fork 1
/
.golangci.yaml
53 lines (53 loc) · 2.37 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
linters:
# Enable presets collections of linters
# https://golangci-lint.run/usage/linters
presets:
- bugs
- comment
- complexity
- error
- format
- import
- metalinter
- module
- performance
- style
- test
- unused
disable:
- cyclop # Cyclomatic complexity limit of 10 per function
- depguard # Rules based linting based on dependency paths (i.e. reject usages of certain libraries)
- err113 # No dynamic errors
- exhaustruct # Struct init must declare all possible fields
- forcetypeassert # Requires if check after every typcast
- funlen # Functions can only have 40 statements
- gci # Import formatter which groups imports by library type
- gocognit # Limits complexity (length) of functions to 30 or less
- gocritic # False positives for replacing if/else with switch
- godox # No TODO/BUG/FIXME comments
- godot # Comments must end in a period
- gofumpt # Alternative code formatting rules for gofmt
- goprintffuncname # Logging function names must end in `f`
- interfacebloat # No more than 10 methods per interface
- intrange # Range instead of (i=0; i < len(...)) in for loops
- ireturn # No interface return types allowed
- lll # Max line length of 120 characters
- mnd # No numeric literals allowed
- nestif # Limits if statements sub conditions to 4 or less
- nlreturn # New line spacing before break, continue, return, etc.
- tagalign # Reorders JSON/YAML field definition tags
- tagliatelle # Field naming style check for JSON, YAML, etc.
- testpackage # Test files should be in a separate package
- varnamelen # No short variable names
- wrapcheck # No unwrapped errors returned from interface functions
- wsl # Opinionated whitespacing rules
issues:
exclude-rules:
- path: _test.go
linters:
- dupl # No duplicate blocks of code
- errcheck # Requires all error return values to be checked with an if statement
- goconst # Detects common literals to refactor as constants
- gochecknoglobals # No global variables
- nilnil # Detects nil, nil returns from functions
- paralleltest