-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangcilint.yml
160 lines (154 loc) · 6.35 KB
/
.golangcilint.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
linters:
# FIXME(roosd): For now, we disable all linters and turn them on one-by-one.
disable-all: true
enable:
# Default linters.
- errcheck
- gosimple
- govet
- ineffassign
- typecheck
- unused
# Extended linters.
- depguard
- exportloopref
- rowserrcheck
- sqlclosecheck
- unconvert
- gofmt
- lll
- misspell
- goheader
linters-settings:
lll:
line-length: 100
tab-width: 4
depguard:
list-type: blacklist
include-go-root: true
packages: "io/ioutil"
packages-with-error-message:
# specify an error message to output when a blacklisted package is used
"io/ioutil": >
"The use of 'io/ioutil' is deprecated. Check
https://pkg.go.dev/io/ioutil for alternatives"
errcheck:
exclude-functions:
- (*github.com/spf13/cobra.Command).MarkFlagRequired
goheader:
values:
regexp:
copyright-lines: "(Copyright 20[0-9][0-9] .*)(\nCopyright 20[0-9][0-9] .*)*"
template: |-
{{copyright-lines}}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
issues:
exclude-rules:
# don't report long lines with long links
- linters: [lll]
source: "http[s]://\\S{80,}$"
# don't report long lines with yaml/json/toml tags
- linters: [lll]
source: "`(yaml|toml|json):\"[^`]*`$"
# these files originate from third-party projects
- path: pkg/private/util/duration.go
linters: [goheader]
- path: pkg/private/serrors/stack.go
linters: [goheader, errcheck]
- path: scion-pki/certs/(certinfo|certformat).go
linters: [lll, goheader, errcheck]
- path: pkg/scrypto/cms
linters: [goheader]
# list of exceptions to the errcheck check
# TODO(matzf): most of these should rather be fixed! It may be ok to be a
# bit more lenient in the test code perhaps, but some of these are lurking
# bugs.
- path: "^control/beacon/policy.go$|\
^control/cmd/control/main.go$|\
^control/colibri/reservation/conf/capacities_test.go$|\
^control/colibri/reservation/e2e/reservation_test.go$|\
^control/colibri/reservation/index_test.go$|\
^control/colibri/reservation/reservationdbtest/reservationdbtest.go$|\
^control/colibri/reservation/segment/path.go$|\
^control/colibri/reservation/segment/reservation_test.go$|\
^control/colibri/reservation/sqlite/db_test.go$|\
^control/colibri/reservationstore/store.go$|\
^control/mgmtapi/api.go$|\
^dispatcher/cmd/dispatcher/main.go$|\
^dispatcher/dispatcher.go$|\
^dispatcher/internal/registration/bench_test.go$|\
^gateway/control/aggregator.go$|\
^gateway/control/engine.go$|\
^gateway/control/engine_test.go$|\
^gateway/control/enginecontroller_test.go$|\
^gateway/control/export_test.go$|\
^gateway/control/remotemonitor.go$|\
^gateway/control/router.go$|\
^gateway/control/session.go$|\
^gateway/control/sessionconfigurator.go$|\
^gateway/control/watcher_test.go$|\
^gateway/dataplane/diagnostics_test.go$|\
^gateway/dataplane/ipforwarder_test.go$|\
^gateway/dataplane/routingtable.go$|\
^gateway/dataplane/session_test.go$|\
^gateway/gateway.go$|\
^gateway/routing/file.go$|\
^gateway/xnet/xnet.go$|\
^pkg/experimental/colibri/reservation/types.go$|\
^pkg/experimental/epic/epic_test.go$|\
^pkg/experimental/hiddenpath/beaconwriter_test.go$|\
^pkg/experimental/hiddenpath/grpc/registerer_test.go$|\
^pkg/experimental/hiddenpath/store_test.go$|\
^pkg/grpc/dialer_test.go$|\
^pkg/log/log.go$|\
^pkg/log/testlog/log.go$|\
^pkg/private/xtest/graph/graph.go$|\
^pkg/private/xtest/grpc.go$|\
^pkg/segment/seg.go$|\
^pkg/segment/segs_test.go$|\
^pkg/slayers/extn_test.go$|\
^pkg/slayers/scion_test.go$|\
^pkg/snet/packet_test.go$|\
^pkg/snet/path.go$|\
^pkg/snet/squic/net.go$|\
^pkg/sock/reliable/reconnect/conn.go$|\
^pkg/sock/reliable/reconnect/conn_io_test.go$|\
^pkg/sock/reliable/reconnect/network_test.go$|\
^pkg/sock/reliable/reconnect/reconnecter_test.go$|\
^pkg/sock/reliable/reliable.go$|\
^private/app/appnet/infraenv.go$|\
^private/app/launcher/launcher.go$|\
^private/app/path/pathprobe/paths.go$|\
^private/config/sample.go$|\
^private/mgmtapi/cppki/api/api.go$|\
^private/mgmtapi/segments/api/api.go$|\
^private/path/combinator/combinator.go$|\
^private/revcache/revcachetest/revcachetest.go$|\
^private/segment/seghandler/storage.go$|\
^private/service/statuspages.go$|\
^private/storage/db/sqler.go$|\
^private/storage/trust/fspersister/db_test.go$|\
^private/svc/internal/ctxconn/ctxconn.go$|\
^private/trust/db_inspector.go$|\
^private/trust/verifier.go$|\
^private/trust/verifier_bench_test.go$|\
^private/worker/worker_test.go$|\
^router/dataplane_test.go$|\
^router/export_test.go$|\
^router/mgmtapi/api.go$|\
^scion-pki/trcs/combine_test.go$|\
^tools/end2end/main.go$|\
^tools/end2end_integration/main.go$|\
^tools/integration/binary.go$|\
^tools/integration/done.go$|\
^tools/integration/integration.go$|\
^tools/integration/progress/progress.go$"
linters: [errcheck]