-
Notifications
You must be signed in to change notification settings - Fork 2
/
.golangci.yml
41 lines (38 loc) · 1.73 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
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
linters-settings:
cyclop:
# The maximal code complexity to report.
# Default: 10
max-complexity: 10
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
- gochecknoglobals # check that no global variables exist
- gocognit # Computes and checks the cognitive complexity of functions
- forbidigo # forbid fmt.Println
- 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
- 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
run:
timeout: 5m
go: '1.21.0'
issues-exit-code: 1
modules-download-mode: readonly