Replace gometalinter with golangci-lint#39668
Merged
yongtang merged 76 commits intomoby:masterfrom Sep 18, 2019
Merged
Conversation
ac28f0f to
23017b8
Compare
This was referenced Aug 5, 2019
11707aa to
349145f
Compare
kolyshkin
reviewed
Aug 6, 2019
kolyshkin
reviewed
Aug 6, 2019
669ca5a to
e03daca
Compare
e03daca to
e793d37
Compare
``` internal/test/environment/environment.go:37:23: `useing` is a misspelling of `using`(misspell) integration/container/wait_test.go:49:9: `waitres` is a misspelling of `waiters`(misspell) integration/container/wait_test.go:95:9: `waitres` is a misspelling of `waiters`(misspell) integration-cli/docker_api_containers_test.go:1042:7: `waitres` is a misspelling of `waiters`(misspell) ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
``` daemon/cluster/controllers/plugin/controller.go:37:2: U1000: field `taskID` is unused (unused) ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
…eck) ``` oci/devices_linux.go:64:72: SA4009: argument e is overwritten before first use (staticcheck) ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
``` pkg/devicemapper/devmapper_wrapper.go:209:206: SA4000: identical expressions on the left and right side of the '==' operator (staticcheck) ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
``` cmd/dockerd/config.go:50:18: Error return value of `flags.MarkHidden` is not checked (errcheck) cmd/dockerd/config.go:55:22: Error return value of `flags.MarkDeprecated` is not checked (errcheck) cmd/dockerd/config.go:78:18: Error return value of `flags.MarkHidden` is not checked (errcheck) ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
…(staticcheck) Keeping this code for now to allow connecting to old daemons, but we might want to remove this at some point ``` client/hijack.go:90:12: SA1019: httputil.ErrPersistEOF is deprecated: No longer used. (staticcheck) ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
…eferring (staticcheck) ``` integration/plugin/graphdriver/external_test.go:427:2: SA5001: should check returned error before deferring responseReader.Close() (staticcheck) ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
Staticcheck reported:
SA9002: file mode '600' evaluates to 01130; did you mean '0600'? (staticcheck)
But fixing that caused the test to fail:
=== Failed
=== FAIL: pkg/filenotify TestPollerEvent (0.80s)
poller_test.go:75: timeout waiting for event CHMOD
The problem turned out to be that the file was created with `0644`. However,
after umask, the file created actually had `0600` filemode. Running the `os.Chmod`
with `0600` therefore was a no-op, causing the test to fail (because no
CHMOD event would fire).
This patch changes the test to;
- create the file with mode `0600`
- assert that the file has the expected mode
- change the chmod to `0644`
- assert that it has the correct mode, before testing the event.
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Replacing gometalinter, because it has been deprecated, and the repository was archived. Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
``` pkg/archive/archive.go:407:3: SA1019: hdr.Xattrs is deprecated: Use PAXRecords instead. (staticcheck) pkg/archive/archive.go:408:3: SA1019: hdr.Xattrs is deprecated: Use PAXRecords instead. (staticcheck) pkg/archive/archive.go:661:26: SA1019: hdr.Xattrs is deprecated: Use PAXRecords instead. (staticcheck) pkg/archive/archive_linux.go:47:7: SA1019: hdr.Xattrs is deprecated: Use PAXRecords instead. (staticcheck) pkg/archive/archive_linux.go:48:12: SA1019: hdr.Xattrs is deprecated: Use PAXRecords instead. (staticcheck) ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
…heck) ``` distribution/registry.go:84:3: SA1019: base.Dial is deprecated: Use DialContext instead, which allows the transport to cancel dials as soon as they are no longer needed. If both are set, DialContext takes priority. (staticcheck) registry/registry.go:188:3: SA1019: base.Dial is deprecated: Use DialContext instead, which allows the transport to cancel dials as soon as they are no longer needed. If both are set, DialContext takes priority. (staticcheck) client/hijack.go:85:16: SA1019: httputil.NewClientConn is deprecated: Use the Client or Transport in package net/http instead. (staticcheck) integration-cli/docker_api_attach_test.go:245:12: SA1019: httputil.NewClientConn is deprecated: Use the Client or Transport in package net/http instead. (staticcheck) integration/plugin/authz/authz_plugin_test.go:180:7: SA1019: httputil.NewClientConn is deprecated: Use the Client or Transport in package net/http instead. (staticcheck) integration/plugin/authz/authz_plugin_test.go:479:12: SA1019: httputil.NewClientConn is deprecated: Use the Client or Transport in package net/http instead. (staticcheck) integration-cli/docker_api_attach_test.go:239:134: SA1019: httputil.ClientConn is deprecated: Use Client or Transport in package net/http instead. (staticcheck) daemon/daemon.go:885:3: SA1019: grpc.WithDialer is deprecated: use WithContextDialer instead. Will be supported throughout 1.x. (staticcheck) pkg/authorization/response.go:18:2: SA1019: http.CloseNotifier is deprecated: the CloseNotifier interface predates Go's context package. New code should use Request.Context instead. (staticcheck) pkg/authorization/response.go:160:30: SA1019: http.CloseNotifier is deprecated: the CloseNotifier interface predates Go's context package. New code should use Request.Context instead. (staticcheck) ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
This reverts commit 01332b5. Signed-off-by: Sebastiaan van Stijn <[email protected]>
4791a94 to
5f67568
Compare
Member
Author
|
rebased 👍 |
AkihiroSuda
approved these changes
Sep 18, 2019
Member
Author
|
🥳🥳 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rebased on top of #39902Replacing gometalinter, because it has been deprecated; https://github.com/alecthomas/gometalinter. Similar PR for the CLI; docker/cli#1797
Quite a few issues were picked by the linters provided by golangci-lint, so unfortunately it's a big PR (some bugixes were already separated out)