This repository has been archived by the owner on Mar 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yaml
135 lines (120 loc) · 4.33 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
run:
# default concurrency is available CPU number
concurrency: 4
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 1m
# exit code when at least one issue was found, default is 1
issues-exit-code: 1
# include test files or not, default is true
tests: true
# Fix found issues (if it's supported by the linter)
fix: true
linters:
enable-all: true
disable:
- exhaustivestruct
- golint
- interfacer
- maligned
- noctx
- scopelint
issues:
exclude-rules:
- path: _test\.go
linters:
- bodyclose
- dupl
- funlen
- gosec
linters-settings:
gomnd:
settings:
mnd:
ignored-functions: math.*,strconv.*
ireturn:
# ireturn allows using `allow` and `reject` settings at the same time.
# Both settings are lists of the keywords and regular expressions matched to interface or package names.
# keywords:
# - `empty` for `interface{}`
# - `error` for errors
# - `stdlib` for standard library
# - `anon` for anonymous interfaces
# By default, it allows using errors, empty interfaces, anonymous interfaces,
# and interfaces provided by the standard library.
# You can specify idiomatic endings for interface
allow:
- anon
- error
- empty
- stdlib
- .*Sqlmock
lll:
# max line length, lines longer will be reported.
# Note how [Effective Go](https://go.dev/doc/effective_go#formatting) doesn't recommend a fixed maximum:
# > Go has no line length limit. Don't worry about overflowing a punched card.
# > If a line feels too long, wrap it and indent with an extra tab.
# Set the length to a large number, if it's that long you should wonder if wrapping wouldn't make sense
line-length: 300
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
# tab width in spaces. Default to 1.
tab-width: 1
nestif:
# minimal complexity of if statements to report (5 by default)
min-complexity: 8
tagliatelle:
# check the struck tag name case
case:
# use the struct field name to check the name of the struct tag
use-field-name: true
rules:
# any struct tag type can be used.
# support string case: `camel`, `pascal`, `kebab`, `snake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`
json: snake
yaml: camel
xml: camel
bson: camel
avro: snake
mapstructure: kebab
varnamelen:
# The longest distance, in source lines, that is being considered a "small scope." (defaults to 5)
# Variables used in at most this many lines will be ignored.
max-distance: 5
# The minimum length of a variable's name that is considered "long." (defaults to 3)
# Variable names that are at least this long will be ignored.
min-name-length: 3
# Check method receiver names. (defaults to false)
check-receiver: false
# Check named return values. (defaults to false)
check-return: false
# Ignore "ok" variables that hold the bool return value of a type assertion. (defaults to false)
ignore-type-assert-ok: false
# Ignore "ok" variables that hold the bool return value of a map index. (defaults to false)
ignore-map-index-ok: false
# Ignore "ok" variables that hold the bool return value of a channel receive. (defaults to false)
ignore-chan-recv-ok: false
# Optional list of variable names that should be ignored completely. (defaults to empty list)
ignore-names:
- err
- db
# Optional list of variable declarations that should be ignored completely. (defaults to empty list)
# Entries must be in the form of "<variable name> <type>" or "<variable name> *<type>" for
# variables, or "const <name>" for constants.
ignore-decls:
- c echo.Context
- t testing.T
- e error
- i int
- const C
wsl:
# See https://github.com/bombsimon/wsl/blob/master/doc/configuration.md for
# documentation of available settings.
allow-assign-and-anything: true
allow-assign-and-call: true
allow-cuddle-declarations: false
allow-multiline-assign: true
allow-separated-leading-comment: false
allow-trailing-comment: false
force-case-trailing-whitespace: 0
force-err-cuddling: true
force-short-decl-cuddling: false
strict-append: true