-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.golangci.yml
165 lines (139 loc) · 6.66 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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
linters:
disable-all: true
enable:
- bodyclose
- errcheck
- gci
- godot
- gofumpt
- goimports
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- prealloc
- revive
- rowserrcheck
- sloglint
- sqlclosecheck
- staticcheck
- testifylint
- thelper
- unconvert
- unparam
- unused
- whitespace
issues:
exclude-use-default: false
exclude-dirs:
# Most of the code of internal/migratekit was copied from the excellent project
# https://github.com/vexxhost/migratekit, Apache-2.0 license.
- internal/migratekit
# Copied from the Go standard library
# https://github.com/golang/go/blob/master/src/net/http/internal/testcert/testcert.go, BSD-3-Clause license
- internal/testcert
linters-settings:
gci:
sections:
- standard
- default
- prefix(github.com/FuturFusion/migration-manager)
goimports:
local-prefixes: github.com/FuturFusion/migration-manager
errcheck:
exclude-functions:
- (io.ReadCloser).Close
- (io.WriteCloser).Close
- (io.ReadWriteCloser).Close
- (*os.File).Close
- (*github.com/gorilla/websocket.Conn).Close
- (*github.com/mdlayher/vsock.Listener).Close
- os.Remove
- (*compress/gzip.Writer).Close
revive:
rules:
# Disabled for now while we are rushing with the development of an initial version.
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#exported
# - name: exported
# arguments:
# - "checkPrivateReceivers"
# - "disableStutteringCheck"
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#import-shadowing
- name: import-shadowing
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#unchecked-type-assertion
- name: unchecked-type-assertion
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#var-naming
- name: var-naming
arguments: # The arguments here are quite odd looking. See the rule description.
- [ ]
- [ ]
- [ { "upperCaseConst": true } ]
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#early-return
- name: early-return
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#redundant-import-alias
- name: redundant-import-alias
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#redefines-builtin-id
- name: redefines-builtin-id
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#struct-tag
- name: struct-tag
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#receiver-naming
- name: receiver-naming
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#deep-exit
- name: deep-exit
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#defer
- name: defer
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#bool-literal-in-expr
- name: bool-literal-in-expr
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#comment-spacings
- name: comment-spacings
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#use-any
- name: use-any
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#bare-return
- name: bare-return
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#empty-block
- name: empty-block
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#range-val-address
- name: range-val-address
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#range-val-in-closure
- name: range-val-in-closure
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#var-declaration
- name: var-declaration
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#useless-break
- name: useless-break
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#error-naming
- name: error-naming
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#indent-error-flow
- name: indent-error-flow
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#datarace
- name: datarace
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#modifies-value-receiver
- name: modifies-value-receiver
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#empty-lines
- name: empty-lines
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#duplicated-imports
- name: duplicated-imports
# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#error-return
- name: error-return
staticcheck:
checks:
- "*"
# Incorrectly formatted error string.
# https://staticcheck.dev/docs/checks/#ST1005
# this has become an established standard in Incus and since we are building
# on top of Incus, we inherit the same style of capitalized error messages.
- "-ST1005"
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
# Enforce using static values for log messages.
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#static-messages
# Default: false
static-msg: true
# Enforce a single key naming convention.
# Values: snake, kebab, camel, pascal
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#key-naming-convention
# Default: ""
key-naming-case: snake