-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
80 lines (68 loc) · 2.35 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
68
69
70
71
72
73
74
75
76
77
78
79
# https://golangci-lint.run/usage/configuration/
#
# The purpose of the linter is to write safe and sane Go code without interfering with code ergonomics.
# Unfortunately Go has many limitations, some of which are placed on you by this linter.
# Before //nolint:'ing consider other ways to discribe your intent in code.
output:
sort-results: true
linters:
enable-all: true
disable:
- nlreturn # Already covered by wsl and revive, and they are more permissive.
- godot # Not all comments should end with a dot.
- ireturn # There is yet to be a usecase for this check. So far its in the way of developers
- depguard # Limited configuration options
- exhaustruct
- exhaustivestruct
severity:
default-severity: error
issues:
exclude:
- 'Example[A-Z][\w\d]+_[A-Z][\w\d]+ contains underscore.*' # Examples are required to be ExampleType_Method
# https://golangci-lint.run/usage/linters/
#
# Does the lint rule you are about to add make sense? Could the trigger be avoided by improving code quality?
linters-settings:
nolintlint:
require-explanation: true
require-specific: true
lll:
line-length: 120
tab-width: 4
tagliatelle:
case:
use-field-name: true
varnamelen:
ignore-decls:
- t T
- t testing.T
- i int
- T any
- a []any
ignore-names:
- id
- ID
forbidigo:
analyze-types: true
forbid:
- p: ^print.*$
msg: &shouldUseLoggingPackage all logging in the app should be done through `package logging`.
- p: ^fmt\.Print.*$
msg: *shouldUseLoggingPackage
- p: ^log\..*$
msg: *shouldUseLoggingPackage
- p: ^errors\.New$
msg: &dontCreateDynErrors consider the receiver of this error, how are they going to handle this error?
govet:
check-shadowing: true
enable-all: true
settings:
printf:
funcs:
- (github.com/m-kuzmin/simple-rest-api/logging.Logger).Tracef
- (github.com/m-kuzmin/simple-rest-api/logging.Logger).Debugf
- (github.com/m-kuzmin/simple-rest-api/logging.Logger).Infof
- (github.com/m-kuzmin/simple-rest-api/logging.Logger).Warnf
- (github.com/m-kuzmin/simple-rest-api/logging.Logger).Errorf
- (github.com/m-kuzmin/simple-rest-api/logging.Logger).Fatalf
- github.com/m-kuzmin/simple-rest-api/api.errorResponsef