-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.golangci.yml
65 lines (60 loc) · 2.79 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
linters:
enable:
# Code Correctness
- bodyclose # Ensures HTTP response bodies are closed
- contextcheck # Checks proper usage of context.Context
- errcheck # Checks error handling
- errorlint # Validates error handling patterns
- exhaustive # Verifies switch statement completeness
- govet # Reports suspicious constructs
- ineffassign # Detects ineffective assignments
- nilerr # Checks for incorrect handling of nil errors
- nilnil # Detects redundant nil checks
- noctx # Finds improper use of background context
- prealloc # Suggests preallocating slices
- rowserrcheck # Ensures database rows and statements are checked for errors
- sqlclosecheck # Ensures database rows and statements are closed
- staticcheck # Comprehensive static analyzer
- typecheck # Checks type correctness
- unused # Finds unused code
# Code Quality
- cyclop # Measures cyclomatic complexity
- funlen # Checks the length of functions
- gocritic # Detects suspicious constructs
- gocyclo # Measures cyclomatic complexity
- gosimple # Suggests code simplifications
- stylecheck # Checks for style issues
- unconvert # Removes unnecessary type conversions
- unparam # Finds unused function parameters
- testifylint # Checks for common mistakes in test code
# Code Style
- asciicheck # Reports non-ASCII characters
- dupl # Finds code duplications
- gci # Groups and sorts imports
- gofmt # Checks for standard formatting
- gofumpt # Enforces stricter formatting
- goimports # Manages imports organization
- makezero # Suggests optimized slice declarations
- misspell # Finds spelling mistakes
- revive # Linter for style and conventions
- tagliatelle # Ensures struct tags are consistent
- whitespace # Checks for inconsistent whitespace
# Best Practices
- gochecknoinits # Warns about `init()` usage
- godot # Ensures comments end with a period
- err113 # Maintains standard error handling style
- nonamedreturns # Detects named return values
- paralleltest # Ensures `t.Parallel()` usage in tests
- tenv # Warns about os.Setenv and os.Clearenv usage
- testpackage # Ensures tests are in the proper package
- thelper # Ensures testing helpers are named correctly
run:
timeout: 1m
issues:
exclude-rules:
- path: _test\.go
linters:
- funlen
- linters:
- err113
text: "do not define dynamic errors"