|
| 1 | +version: "2" |
| 2 | + |
1 | 3 | run: |
2 | | - timeout: 8m |
3 | | - tests: true |
4 | 4 | build-tags: |
5 | 5 | - admin |
6 | 6 | - functional |
7 | 7 | - integration |
| 8 | + tests: true |
8 | 9 |
|
9 | 10 | linters: |
10 | 11 | enable: |
11 | | - # defaults: |
12 | | - # - errcheck |
13 | | - # - gosimple |
14 | | - # - govet |
15 | | - # - ineffassign |
16 | | - # - staticcheck |
17 | | - # - typecheck |
18 | | - # - unused |
19 | | - |
20 | 12 | - errorlint # error wrapping (eg, not using `errors.Is`, using `%s` instead of `%w` in `fmt.Errorf`) |
21 | | - - gofmt # whether code was gofmt-ed |
22 | | - - govet # enabled by default, but just to be sure |
23 | 13 | - nolintlint # ill-formed or insufficient nolint directives |
24 | | - - stylecheck # golint replacement |
25 | 14 | - thelper # test helpers without t.Helper() |
26 | 15 |
|
27 | | -linters-settings: |
28 | | - govet: |
29 | | - enable-all: true |
30 | | - disable: |
31 | | - # struct order is often for Win32 compat |
32 | | - # also, ignore pointer bytes/GC issues for now until performance becomes an issue |
33 | | - - fieldalignment |
34 | | - |
35 | | - stylecheck: |
36 | | - # https://staticcheck.io/docs/checks |
37 | | - checks: ["all"] |
38 | | - |
39 | | -issues: |
40 | | - exclude-dirs: |
41 | | - # paths are relative to module root |
42 | | - - cri-containerd/test-images |
43 | | - exclude-rules: |
44 | | - # err is very often shadowed in nested scopes |
45 | | - - linters: |
46 | | - - govet |
47 | | - text: '^shadow: declaration of "err" shadows declaration' |
48 | | - |
49 | | - # path is relative to module root, which is ./test/ |
50 | | - - path: cri-containerd |
51 | | - linters: |
52 | | - - stylecheck |
53 | | - text: "^ST1003: should not use underscores in package names$" |
54 | | - source: "^package cri_containerd$" |
55 | | - |
56 | | - # don't bother with propper error wrapping in test code |
57 | | - - path: cri-containerd |
58 | | - linters: |
59 | | - - errorlint |
60 | | - text: "non-wrapping format verb for fmt.Errorf" |
61 | | - |
62 | | - # This repo has a LOT of generated schema files, operating system bindings, and other |
63 | | - # things that ST1003 from stylecheck won't like (screaming case Windows api constants for example). |
64 | | - # There's also some structs that we *could* change the initialisms to be Go friendly |
65 | | - # (Id -> ID) but they're exported and it would be a breaking change. |
66 | | - # This makes it so that most new code, code that isn't supposed to be a pretty faithful |
67 | | - # mapping to an OS call/constants, or non-generated code still checks if we're following idioms, |
68 | | - # while ignoring the things that are just noise or would be more of a hassle than it'd be worth to change. |
69 | | - - path: layer.go |
70 | | - linters: |
71 | | - - stylecheck |
72 | | - text: "ST1003:" |
73 | | - |
74 | | - - path: hcsshim.go |
75 | | - linters: |
76 | | - - stylecheck |
77 | | - text: "ST1003:" |
78 | | - |
79 | | - - path: cmd\\ncproxy\\nodenetsvc\\ |
80 | | - linters: |
81 | | - - stylecheck |
82 | | - text: "ST1003:" |
83 | | - |
84 | | - - path: cmd\\ncproxy_mock\\ |
85 | | - linters: |
86 | | - - stylecheck |
87 | | - text: "ST1003:" |
88 | | - |
89 | | - - path: internal\\hcs\\schema2\\ |
90 | | - linters: |
91 | | - - stylecheck |
92 | | - - gofmt |
93 | | - |
94 | | - - path: internal\\wclayer\\ |
95 | | - linters: |
96 | | - - stylecheck |
97 | | - text: "ST1003:" |
98 | | - |
99 | | - - path: hcn\\ |
100 | | - linters: |
101 | | - - stylecheck |
102 | | - text: "ST1003:" |
103 | | - |
104 | | - - path: internal\\hcs\\schema1\\ |
105 | | - linters: |
106 | | - - stylecheck |
107 | | - text: "ST1003:" |
108 | | - |
109 | | - - path: internal\\hns\\ |
110 | | - linters: |
111 | | - - stylecheck |
112 | | - text: "ST1003:" |
113 | | - |
114 | | - - path: ext4\\internal\\compactext4\\ |
115 | | - linters: |
116 | | - - stylecheck |
117 | | - text: "ST1003:" |
118 | | - |
119 | | - - path: ext4\\internal\\format\\ |
120 | | - linters: |
121 | | - - stylecheck |
122 | | - text: "ST1003:" |
123 | | - |
124 | | - - path: internal\\guestrequest\\ |
125 | | - linters: |
126 | | - - stylecheck |
127 | | - text: "ST1003:" |
128 | | - |
129 | | - - path: internal\\guest\\prot\\ |
130 | | - linters: |
131 | | - - stylecheck |
132 | | - text: "ST1003:" |
133 | | - |
134 | | - - path: internal\\windevice\\ |
135 | | - linters: |
136 | | - - stylecheck |
137 | | - text: "ST1003:" |
138 | | - |
139 | | - - path: internal\\winapi\\ |
140 | | - linters: |
141 | | - - stylecheck |
142 | | - text: "ST1003:" |
143 | | - |
144 | | - - path: internal\\vmcompute\\ |
145 | | - linters: |
146 | | - - stylecheck |
147 | | - text: "ST1003:" |
148 | | - |
149 | | - - path: internal\\regstate\\ |
150 | | - linters: |
151 | | - - stylecheck |
152 | | - text: "ST1003:" |
153 | | - |
154 | | - - path: internal\\hcserror\\ |
155 | | - linters: |
156 | | - - stylecheck |
157 | | - text: "ST1003:" |
158 | | - |
159 | | - # v0 APIs are deprecated, but still retained for backwards compatability |
160 | | - - path: cmd\\ncproxy\\ |
161 | | - linters: |
162 | | - - staticcheck |
163 | | - text: "^SA1019: .*(ncproxygrpc|nodenetsvc)[/]?v0" |
164 | | - |
165 | | - - path: internal\\tools\\networkagent |
166 | | - linters: |
167 | | - - staticcheck |
168 | | - text: "^SA1019: .*nodenetsvc[/]?v0" |
169 | | - |
170 | | - - path: internal\\vhdx\\info |
171 | | - linters: |
172 | | - - stylecheck |
173 | | - text: "ST1003:" |
| 16 | + settings: |
| 17 | + govet: |
| 18 | + disable: |
| 19 | + # struct order is often for Win32 compat |
| 20 | + # also, ignore pointer bytes/GC issues for now until performance becomes an issue |
| 21 | + - fieldalignment |
| 22 | + enable-all: true |
| 23 | + |
| 24 | + staticcheck: |
| 25 | + # https://staticcheck.io/docs/checks |
| 26 | + checks: |
| 27 | + - all |
| 28 | + |
| 29 | + exclusions: |
| 30 | + generated: lax |
| 31 | + presets: |
| 32 | + - comments |
| 33 | + - common-false-positives |
| 34 | + - legacy |
| 35 | + - std-error-handling |
| 36 | + rules: |
| 37 | + # err is very often shadowed in nested scopes |
| 38 | + - linters: |
| 39 | + - govet |
| 40 | + text: '^shadow: declaration of "err" shadows declaration' |
| 41 | + |
| 42 | + # path is relative to module root, which is ./test/ |
| 43 | + - linters: |
| 44 | + - staticcheck |
| 45 | + path: cri-containerd |
| 46 | + text: "^ST1003: should not use underscores in package names$" |
| 47 | + source: ^package cri_containerd$ |
| 48 | + |
| 49 | + # don't bother with propper error wrapping in test code |
| 50 | + - linters: |
| 51 | + - errorlint |
| 52 | + path: cri-containerd |
| 53 | + text: non-wrapping format verb for fmt.Errorf |
| 54 | + |
| 55 | + # static check doesn't recognize `t.Fatal[f]?` when checking for potential `nil` pointer dereference |
| 56 | + - linters: |
| 57 | + - staticcheck |
| 58 | + path: ".*_test.go$" |
| 59 | + text: "^SA5011" |
| 60 | + |
| 61 | + # This repo has a LOT of generated schema files, operating system bindings, and other |
| 62 | + # things that ST1003 from stylecheck won't like (screaming case Windows api constants for example). |
| 63 | + # There's also some structs that we *could* change the initialisms to be Go friendly |
| 64 | + # (Id -> ID) but they're exported and it would be a breaking change. |
| 65 | + # This makes it so that most new code, code that isn't supposed to be a pretty faithful |
| 66 | + # mapping to an OS call/constants, or non-generated code still checks if we're following idioms, |
| 67 | + # while ignoring the things that are just noise or would be more of a hassle than it'd be worth to change. |
| 68 | + - linters: |
| 69 | + - staticcheck |
| 70 | + path: layer.go |
| 71 | + text: "ST1003:" |
| 72 | + - linters: |
| 73 | + - staticcheck |
| 74 | + path: hcsshim.go |
| 75 | + text: "ST1003:" |
| 76 | + - linters: |
| 77 | + - staticcheck |
| 78 | + path: cmd/ncproxy/nodenetsvc/ |
| 79 | + text: "ST1003:" |
| 80 | + - linters: |
| 81 | + - staticcheck |
| 82 | + path: cmd/ncproxy_mock/ |
| 83 | + text: "ST1003:" |
| 84 | + - linters: |
| 85 | + - staticcheck |
| 86 | + path: internal/hcs/schema2/ |
| 87 | + - linters: |
| 88 | + - staticcheck |
| 89 | + path: internal/wclayer/ |
| 90 | + text: "ST1003:" |
| 91 | + - linters: |
| 92 | + - staticcheck |
| 93 | + path: hcn/ |
| 94 | + text: "ST1003:" |
| 95 | + - linters: |
| 96 | + - staticcheck |
| 97 | + path: internal/hcs/schema1/ |
| 98 | + text: "ST1003:" |
| 99 | + - linters: |
| 100 | + - staticcheck |
| 101 | + path: internal/hns/ |
| 102 | + text: "ST1003:" |
| 103 | + - linters: |
| 104 | + - staticcheck |
| 105 | + path: ext4/internal/compactext4/ |
| 106 | + text: "ST1003:" |
| 107 | + - linters: |
| 108 | + - staticcheck |
| 109 | + path: ext4/internal/format/ |
| 110 | + text: "ST1003:" |
| 111 | + - linters: |
| 112 | + - staticcheck |
| 113 | + path: internal/guestrequest/ |
| 114 | + text: "ST1003:" |
| 115 | + - linters: |
| 116 | + - staticcheck |
| 117 | + path: internal/guest/prot/ |
| 118 | + text: "ST1003:" |
| 119 | + - linters: |
| 120 | + - staticcheck |
| 121 | + path: internal/windevice/ |
| 122 | + text: "ST1003:" |
| 123 | + - linters: |
| 124 | + - staticcheck |
| 125 | + path: internal/winapi/ |
| 126 | + text: "ST1003:" |
| 127 | + - linters: |
| 128 | + - staticcheck |
| 129 | + path: internal/vmcompute/ |
| 130 | + text: "ST1003:" |
| 131 | + - linters: |
| 132 | + - staticcheck |
| 133 | + path: internal/regstate/ |
| 134 | + text: "ST1003:" |
| 135 | + - linters: |
| 136 | + - staticcheck |
| 137 | + path: internal/hcserror/ |
| 138 | + text: "ST1003:" |
| 139 | + |
| 140 | + # v0 APIs are deprecated, but still retained for backwards compatability |
| 141 | + - linters: |
| 142 | + - staticcheck |
| 143 | + path: cmd/ncproxy/ |
| 144 | + text: "^SA1019: .*(ncproxygrpc|nodenetsvc)[/]?v0" |
| 145 | + - linters: |
| 146 | + - staticcheck |
| 147 | + path: internal/tools/networkagent |
| 148 | + text: "^SA1019: .*nodenetsvc[/]?v0" |
| 149 | + - linters: |
| 150 | + - staticcheck |
| 151 | + path: internal/vhdx/info |
| 152 | + text: "ST1003:" |
| 153 | + |
| 154 | + paths: |
| 155 | + # paths are relative to module root |
| 156 | + - cri-containerd/test-images |
| 157 | + |
| 158 | +formatters: |
| 159 | + enable: |
| 160 | + - gofmt |
| 161 | + exclusions: |
| 162 | + generated: lax |
| 163 | + paths: |
| 164 | + - cri-containerd/test-images |
| 165 | + - internal/hcs/schema2/ |
0 commit comments