Repository navigation
Expand file tree
/
Copy path.golangci.yaml
More file actions
134 lines (120 loc) · 3.67 KB
/
Copy path.golangci.yaml
File metadata and controls
134 lines (120 loc) · 3.67 KB
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
version: "2"
run:
timeout: "5m"
relative-path-mode: "gomod"
formatters:
enable:
- "gofumpt"
- "goimports"
settings:
goimports:
# A list of prefixes, which, if set, checks import paths
# with the given prefixes are grouped after 3rd-party packages.
# Default: []
local-prefixes:
- "miniflux.app/v2"
linters:
enable:
- "asciicheck"
- "bidichk"
- "bodyclose"
- "copyloopvar"
- "embeddedstructfieldcheck"
- "errorlint"
- "gocritic"
- "makezero"
- "misspell"
- "nilnesserr"
- "nolintlint"
- "perfsprint"
- "prealloc"
- "predeclared"
- "sloglint"
- "sqlclosecheck"
- "testifylint"
- "unconvert"
- "usestdlibvars"
- "usetesting"
- "wastedassign"
- "wrapcheck"
settings:
errcheck:
exclude-functions:
# List of functions to exclude from checking, where each entry is a
# single function to exclude. See
# https://github.com/kisielk/errcheck#excluding-functions for details.
- "io/ioutil.ReadFile"
- "io.Copy(*bytes.Buffer)"
- "io.Copy(os.Stdout)"
- "(*compress/flate.Writer).Close"
- "(*compress/gzip.Writer).Close"
- "(*database/sql.DB).Close"
- "(*database/sql.Rows).Close"
- "(*database/sql.Tx).Rollback"
- "(io.Closer).Close"
- "(mime/multipart.File).Close"
- "(net.Conn).Close"
- "(net.Listener).Close"
- "(*os.File).Close"
- "(io/fs.File).Close"
- "golang.org/x/term.Restore"
- "(*github.com/andybalholm/brotli/matchfinder.Writer).Close"
# Display function signature instead of selector.
# Default: false
verbose: true
errorlint:
allowed-errors:
- err: "io.EOF"
fun: "io.ReadAll"
nolintlint:
# Enable to require an explanation of nonzero length after each nolint
# directive.
# Default: false
require-explanation: true
# Enable to require nolint directives to mention the specific linter being
# suppressed.
# Default: false
require-specific: true
sloglint:
# Enforce using attributes only (overrides no-mixed-args, incompatible with kv-only).
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#attributes-only
# Default: false
attr-only: true
staticcheck:
# SAxxxx checks in https://staticcheck.dev/docs/configuration/options/#checks
# Example (to disable some checks): [ "all", "-SA1000", "-SA1001"]
# Default: ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022"]
checks:
- "all"
- "-ST1000"
- "-ST1003"
# Poorly chosen receiver name
# https://staticcheck.dev/docs/checks/#ST1006
- "-ST1006"
# ST1011 - Poorly chosen name for variable of type time.Duration
# https://staticcheck.dev/docs/checks/#ST1011
- "-ST1011"
- "-ST1016"
- "-ST1020"
- "-ST1021"
- "-ST1022"
usetesting:
# Enable/disable `os.Setenv()` detections.
# Default: false
os-setenv: true
# Enable/disable `os.TempDir()` detections.
# Default: false
os-temp-dir: true
wrapcheck:
# An array of glob patterns which, if any match the package of the function
# returning the error, will skip wrapcheck analysis for this error. This is
# useful for broadly ignoring packages and/or subpackages from wrapcheck
# analysis. There are no defaults for this value.
ignore-package-globs:
- "miniflux.app/v2/*"
exclusions:
rules:
- path: '_test\.go'
linters:
- "errcheck"
- "wrapcheck"