-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Replace gometalinter with Golangci lint [carry 1797] #2173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
4d98ed0 to
9ac1954
Compare
277dadd to
4efb4fe
Compare
43a089c to
d220897
Compare
|
This should be good for review now; but still needs a rebase after #2174 is merged ping @kolyshkin @silvin-lubecki @vdemeester @tiborvass PTAL |
vdemeester
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
oh, needs a minor rebase after #2172 was merged; will do so in a bit |
d220897 to
3aac14a
Compare
silvin-lubecki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Ha! Linting is failing because I added options to a test-utility that I didn't use in the end I did that of course to show how well the linter works 😜 |
3aac14a to
6b0d31d
Compare
…taticcheck) Signed-off-by: Silvin Lubecki <[email protected]> Signed-off-by: Sebastiaan van Stijn <[email protected]>
…checked (errcheck) ``` cli/command/formatter/container_test.go:315:17: Error return value of `ContainerWrite` is not checked (errcheck) ContainerWrite(context.context, containers) ^ ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
…l (scopelint) ``` cli/config/config_test.go:590:11: Using the variable on range scope `tc` in function literal (scopelint) SetDir(tc.dir) ^ cli/config/config_test.go:591:19: Using the variable on range scope `tc` in function literal (scopelint) f, err := Path(tc.path...) ^ cli/config/config_test.go:592:23: Using the variable on range scope `tc` in function literal (scopelint) assert.Equal(t, f, tc.expected) ^ ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
…n literal (scopelint)
```
service/logs/parse_logs_test.go:26:35: Using the variable on range scope `testcase` in function literal (scopelint)
actual, err := ParseLogDetails(testcase.line)
^
service/logs/parse_logs_test.go:27:7: Using the variable on range scope `testcase` in function literal (scopelint)
if testcase.err != nil {
^
service/logs/parse_logs_test.go:28:26: Using the variable on range scope `testcase` in function literal (scopelint)
assert.Error(t, err, testcase.err.Error())
^
```
Signed-off-by: Sebastiaan van Stijn <[email protected]>
…iteral (scopelint) ``` templates/templates_test.go:74:29: Using the variable on range scope `testCase` in function literal (scopelint) assert.Check(t, is.Equal(testCase.expected, b.String())) ^ ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
… `overrideService` (scopelint)
```
cli/compose/loader/merge.go:64:41: Using a reference for the variable on range scope `overrideService` (scopelint)
if err := mergo.Merge(&baseService, &overrideService, mergo.WithAppendSlice, mergo.WithOverride, mergo.WithTransformers(specials)); err != nil {
^
cli/compose/loader/loader_test.go:1587:28: Using the variable on range scope `testcase` in function literal (scopelint)
config, err := loadYAML(testcase.yaml)
^
cli/compose/loader/loader_test.go:1590:58: Using the variable on range scope `testcase` in function literal (scopelint)
assert.Check(t, is.DeepEqual(config.Services[0].Init, testcase.init))
^
```
Signed-off-by: Sebastiaan van Stijn <[email protected]>
… literal (scopelint) ``` e2e/cli-plugins/flags_test.go:135:27: Using the variable on range scope `args` in function literal (scopelint) res := icmd.RunCmd(run(args...)) ^ ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
…n literal (scopelint) ``` cli/command/context/create_test.go:270:31: Using the variable on range scope `c` in function literal (scopelint) Name: c.name, ^ cli/command/context/create_test.go:271:31: Using the variable on range scope `c` in function literal (scopelint) Description: c.description, ^ cli/command/context/create_test.go:272:31: Using the variable on range scope `c` in function literal (scopelint) DefaultStackOrchestrator: c.orchestrator, cli/command/context/create_test.go:346:31: Using the variable on range scope `c` in function literal (scopelint) Name: c.name, ^ cli/command/context/create_test.go:347:31: Using the variable on range scope `c` in function literal (scopelint) Description: c.description, ^ cli/command/context/create_test.go:348:31: Using the variable on range scope `c` in function literal (scopelint) DefaultStackOrchestrator: c.orchestrator, ^ ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
…nction literal (scopelint) ``` cli/command/trust/key_load_test.go:121:27: Using the variable on range scope `keyID` in function literal (scopelint) testLoadKeyFromPath(t, keyID, keyBytes) ^ cli/command/trust/key_load_test.go:176:32: Using the variable on range scope `keyBytes` in function literal (scopelint) testLoadKeyTooPermissive(t, keyBytes) ^ ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
… literal (scopelint) ``` cli/command/cli_test.go:157:15: Using the variable on range scope `testcase` in function literal (scopelint) pingFunc: testcase.pingFunc, ^ ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
```
cli/config/config_test.go:465: unnecessary trailing newline (whitespace)
}
cli/compose/interpolation/interpolation.go:56: unnecessary leading newline (whitespace)
switch value := value.(type) {
cli/compose/interpolation/interpolation.go:94: unnecessary trailing newline (whitespace)
}
cli/command/image/build/context.go:348: unnecessary trailing newline (whitespace)
}
internal/licenseutils/client_test.go:98: unnecessary leading newline (whitespace)
func (c *fakeLicensingClient) LoadLocalLicense(ctx context.Context, dclnt licensing.WrappedDockerClient) (*model.Subscription, error) {
cli/registry/client/fetcher.go:211: unnecessary leading newline (whitespace)
for _, endpoint := range endpoints {
```
Signed-off-by: Sebastiaan van Stijn <[email protected]>
```
internal/licenseutils/client_test.go:98: unnecessary leading newline (whitespace)
func (c *fakeLicensingClient) LoadLocalLicense(ctx context.Context, dclnt licensing.WrappedDockerClient) (*model.Subscription, error) {
```
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
```
cli/command/container/opts_test.go:68:2: declaration has 3 blank identifiers (dogsled)
_, _, _, err := parseRun(strings.Split(args+" ubuntu bash", " "))
^
cli/command/container/opts_test.go:542:2: declaration has 3 blank identifiers (dogsled)
_, _, _, err = parseRun([]string{"--uts=container:", "img", "cmd"})
^
cli/command/container/opts_test.go:603:2: declaration has 3 blank identifiers (dogsled)
_, _, _, err := parseRun([]string{"--rm", "--restart=always", "img", "cmd"})
^
```
Signed-off-by: Sebastiaan van Stijn <[email protected]>
…ion literal (scopelint) ``` cli/compose/template/template_test.go:279:31: Using the variable on range scope `tc` in function literal (scopelint) actual := ExtractVariables(tc.dict, defaultPattern) ^ cli/compose/template/template_test.go:280:41: Using the variable on range scope `tc` in function literal (scopelint) assert.Check(t, is.DeepEqual(actual, tc.expected)) ^ ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
…n literal (scopelint)
```
cli/manifest/store/store_test.go:97:29: Using the variable on range scope `testcase` in function literal (scopelint)
actual, err := store.Get(testcase.listRef, testcase.manifestRef)
^
cli/manifest/store/store_test.go:98:7: Using the variable on range scope `testcase` in function literal (scopelint)
if testcase.expectedErr != "" {
^
cli/manifest/store/store_test.go:99:26: Using the variable on range scope `testcase` in function literal (scopelint)
assert.Error(t, err, testcase.expectedErr)
^
```
Signed-off-by: Sebastiaan van Stijn <[email protected]>
…pelint)
```
opts/network_test.go:74:35: Using the variable on range scope `tc` in function literal (scopelint)
assert.NilError(t, network.Set(tc.value))
^
opts/network_test.go:102:40: Using the variable on range scope `tc` in function literal (scopelint)
assert.ErrorContains(t, network.Set(tc.value), tc.expectedError)
^
opts/opts_test.go:270:30: Using the variable on range scope `tc` in function literal (scopelint)
val, err := ValidateLabel(tc.value)
^
opts/opts_test.go:271:7: Using the variable on range scope `tc` in function literal (scopelint)
if tc.expectedErr != "" {
^
```
Signed-off-by: Sebastiaan van Stijn <[email protected]>
…ange scope `obj` (scopelint)
```
cli/command/stack/kubernetes/watcher_test.go:44:20: Using a reference for the variable on range scope `obj` (scopelint)
if err := o.Add(&obj); err != nil {
^
cli/command/stack/kubernetes/watcher_test.go:49:20: Using a reference for the variable on range scope `obj` (scopelint)
if err := o.Add(&obj); err != nil {
^
```
Signed-off-by: Sebastiaan van Stijn <[email protected]>
…ion literal (scopelint)
```
cli/command/container/create_test.go:120:20: Using the variable on range scope `c` in function literal (scopelint)
defer func() { c.ResponseCounter++ }()
^
cli/command/container/create_test.go:121:12: Using the variable on range scope `c` in function literal (scopelint)
switch c.ResponseCounter {
^
```
Signed-off-by: Sebastiaan van Stijn <[email protected]>
…n function literal (scopelint) ``` cli/command/stack/kubernetes/convert_test.go:199:35: Using the variable on range scope `c` in function literal (scopelint) conv, err := NewStackConverter(c.version) ^ ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
```
cli/command/service/client_test.go:75:41: `newService` - `opts` always receives `nil` (unparam)
func newService(id string, name string, opts ...func(*swarm.Service)) swarm.Service {
^
```
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Silvin Lubecki <[email protected]> Signed-off-by: Sebastiaan van Stijn <[email protected]>
6b0d31d to
b7e06f2
Compare
|
rebased; all green again; I'll go ahead and merge |
carries #1797
closes #1797