-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.golangci.yml
60 lines (56 loc) · 2.54 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
issues:
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-issues-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0
exclude-rules:
- path: (.+)_test.go
linters:
- prealloc
linters-settings:
cyclop:
# The maximal code complexity to report.
# Default: 10
max-complexity: 10
errcheck:
check-type-assertions: true
lll:
# max line length, lines longer will be reported. Default is 120.
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
line-length: 120
misspell:
locale: US
# https://golangci-lint.run/usage/linters/
linters:
enable:
- bodyclose # checks whether HTTP response body is closed successfully
- cyclop # checks function and package cyclomatic complexity
- dupl # tool for code clone detection
- errcheck # checks for unchecked errors
- gochecknoglobals # check that no global variables exist
- forbidigo # forbid fmt.Println
- gocognit # computes and checks the cognitive complexity of functions
- goconst # finds repeated strings that could be replaced by a constant
- gofmt # gofmt checks whether code was gofmt-ed
- goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt.
- gosec # inspects source code for security problems
- ineffassign # detects ineffectual assignments
- misspell # finds commonly misspelled English words in comments
- nakedret # finds naked returns in functions greater than a specified function length.
- prealloc # finds slice declarations that could potentially be pre-allocated
- revive # replaces deprecated golint
- sloglint # ensure consistent code style when using log/slog
- spancheck # checks for mistakes with OpenTelemetry/Census spans
- sqlclosecheck # checks that sql.Rows and sql.Stmt are closed
- staticcheck # comprehensive static analyzer
- stylecheck # is a replacement for golint
- testifylint # checks usage of github.com/stretchr/testify
- unused # checks for unused constants, variables, functions and types
- whitespace # detects leading and trailing whitespace
run:
timeout: 5m
tests: true
issues-exit-code: 1
modules-download-mode: readonly
service:
golangci-lint-version: 1.64.x