-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yaml
65 lines (61 loc) · 2.71 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
54
55
56
57
58
59
60
61
62
63
64
65
# GolangCI-Lint
# this workspace is using golangci-lint for linting, so you need to install it.
## MacOS Installation (HomeBrew)
# $ brew install golangci-lint
# See more: https://golangci-lint.run/usage/install/
## VSCode Integrations (for User Settings)
# 1. Open VSCode Settings (JSON)
# 2. in configs, add field `go.lintTool` and value `golangci-lint` ("go.lintTool":"golangci-lint")
# See more: https://golangci-lint.run/usage/integrations/
# See more: https://golangci-lint.run/usage/configuration/#run-configuration
run:
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 10m
# Include test files or not.
# Default: true
tests: false
# Allow multiple parallel golangci-lint instances running.
# If false (default) - golangci-lint acquires file lock on start.
allow-parallel-runners: false
# See more: https://golangci-lint.run/usage/linters/
linters:
disable-all: true
enable:
### Metalinter
- staticcheck # bugs, metalinter - https://staticcheck.io
- govet # bugs, metalinter
- gocritic # style, metalinter - https://github.com/go-critic/go-critic
- revive # style, metalinter - https://github.com/mgechev/revive
### Other Linters
- gosimple # style
- ineffassign # unused
- typecheck # bugs
- unused # unused
- errcheck # bugs, error
- bodyclose # performance, bugs - checks whether HTTP response body is closed successfully
- misspell # style, comment - Finds commonly misspelled English words in comments. https://github.com/client9/misspell
- durationcheck # bugs - check for two durations multiplied together
- gofumpt # format - Gofumpt checks whether code was gofumpt-ed.
- goimports # format, import - In addition to fixing imports, goimports also formats your code in the same style as gofmt.
- whitespace # style - Tool for detection of leading and trailing whitespace.
- nosprintfhostport # style - Checks for misuse of Sprintf to construct a host with port in a URL.
- usestdlibvars # style - detect the possibility to use variables/constants from the Go standard library
- goconst # style - Finds repeated strings that could be replaced by a constant
- unconvert # style - unnecessary type conversions
- prealloc # performance - Find slice declarations that could potentially be pre-allocated, https://github.com/alexkohler/prealloc
- gosec # bugs - Inspects source code for security problems
issues:
# Maximum issues count per one linter.
max-issues-per-linter: 50
# Maximum count of issues with the same text.
max-same-issues: 5
# Fix found issues (if it's supported by the linter).
fix: true
linters-settings:
misspell:
locale: US
ignore-words: []
goconst:
ignore-tests: true
min-occurrences: 5