-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
67 lines (64 loc) · 2.39 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
66
67
# Options for analysis running.
run:
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
limit: 5m
linters:
# Enable additional linters
enable:
- varnamelen # Checks that the length of a variable's name matches its scope.
- errname # Checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error.
- exportloopref # Checks for pointers to enclosing loop variables.
- gochecknoglobals # Check that no global variables exist
- goerr113 # Go linter to check the errors handling expressions.
- promlinter # Check Prometheus metrics naming via promlint.
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint.
- errorlint # Find code that will cause problems with the error wrapping scheme introduced in Go 1.13.
linters-settings:
varnamelen:
# The longest distance, in source lines, that is being considered a "small scope".
# Variables used in at most this many lines will be ignored.
# Default: 5
max-distance: 7
# Optional list of variable names that should be ignored completely.
# Default: []
ignore-names:
- err
- tx
- id
- ok
- tt
# Optional list of variable declarations that should be ignored completely.
# Entries must be in one of the following forms (see below for examples):
# - for variables, parameters, named return values, method receivers, or type parameters:
# <name> <type> (<type> can also be a pointer/slice/map/chan/...)
# - for constants: const <name>
#
# Default: []
ignore-decls:
- t testing.T
- e error
- i int
- ix int
- wg sync.WaitGroup
- eg errgroup.Group
revive:
severity: error
ignore-generated-header: true # ignores files with "GENERATED" header
rules:
- name: exported # Exported function and methods should have comments
disabled: false
arguments:
- "checkPrivateReceivers" # enables checking public methods of private types
issues:
# Fix found issues (if it's supported by the linter).
fix: false
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- errcheck
- goerr113
include:
- EXC0012 # include back that exported stuff should have comment