forked from google/cadvisor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Carefully fixing style (google#2509)
* Use golangci-lint to add lint presubmit test, and fix linter errors Signed-off-by: Maciej "Iwan" Iwanowski <maciej.iwanowski@intel.com>
- Loading branch information
iwankgb
authored
Apr 22, 2020
1 parent
1223982
commit 854445c
Showing
67 changed files
with
1,490 additions
and
1,398 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
run: | ||
linters-settings: | ||
govet: | ||
enable-all: true | ||
golint: | ||
min-confidence: 0 | ||
linters: | ||
disable-all: true | ||
enable: | ||
- govet | ||
- errcheck | ||
- staticcheck | ||
- unused | ||
- gosimple | ||
- structcheck | ||
- varcheck | ||
- ineffassign | ||
- deadcode | ||
- typecheck | ||
- golint | ||
issues: | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
exclude-case-sensitive: true | ||
exclude: | ||
# integration/tests/api/event_test.go:66:6: func `waitForStaticEvent` is unused (unused) | ||
# Flaky test skipped. | ||
- waitForStaticEvent | ||
# Initialism or acronyms for fields, vars and types: | ||
- "(struct field|var|type|const) `[A-Z].*` should be `.*`" | ||
# Initialism or acronyms - renaming exported methods and functions can be tricky: | ||
- "(method|func) [A-Z].* should be .*" | ||
# Stuttering affects exported names: | ||
- "type name will be used as .*\\.[A-Z]{1}.* by other packages, and that stutters" | ||
# We would have to change exported function return type: | ||
- "exported func .* returns unexported type" | ||
exclude-rules: | ||
# container/containerd/client.go:67:4: SA1019: grpc.WithDialer is deprecated: use WithContextDialer instead. Will be supported throughout 1.x. (staticcheck) | ||
# There are more similar issues in following lines. | ||
- path: container/containerd/client.go | ||
text: "SA1019:" | ||
# utils/cpuload/netlink/netlink.go:102:15: Error return value of `binary.Write` is not checked (errcheck) | ||
# There are more similar issues in this file | ||
- path: utils/cpuload/netlink/netlink.go | ||
text: "Error return value of `binary.Write` is not checked" | ||
# utils/cloudinfo/aws/aws.go:60:28: SA1019: session.New is deprecated: Use NewSession functions to create sessions instead. NewSession has the same functionality as New except an error can be returned when the func is called instead of waiting to receive an error until a request is made. (staticcheck) | ||
- path: utils/cloudinfo/aws/aws.go | ||
text: "SA1019:" | ||
# events/handler.go:151:51: exported func NewEventManager returns unexported type *github.com/google/cadvisor/events.events, which can be annoying to use (golint) | ||
- path: events/handler.go | ||
text: "exported func NewEventManager returns unexported type .{1}github.com/google/cadvisor/events.events, which can be annoying to use" | ||
# manager/manager_test.go:277:29: Error return value of `(*github.com/google/cadvisor/container/testing.MockContainerHandler).GetSpec` is not checked (errcheck) | ||
- path: manager/manager_test.go | ||
text: "Error return value of `.{2}github.com/google/cadvisor/container/testing.MockContainerHandler.{1}.GetSpec` is not checked" | ||
# utils/sysinfo/sysinfo.go:208:7: ineffectual assignment to `err` (ineffassign) | ||
- path: utils/sysinfo/sysinfo.go | ||
text: "ineffectual assignment to `err`|SA4006:" | ||
# cache/memory/memory_test.go:81:23: Error return value of `memoryCache.AddStats` is not checked (errcheck) | ||
- path: cache/memory/memory_test.go | ||
text: "Error return value of `memoryCache.AddStats` is not checked" |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.