Skip to content
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

ci: enable new linters #1064

Merged
merged 1 commit into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# See https://golangci-lint.run/usage/configuration/ for available options.
# Also https://github.com/cilium/cilium/blob/master/.golangci.yaml as a
# Also https://github.com/cilium/cilium/blob/main/.golangci.yaml as a
# reference.
run:
go: '1.20'
Expand Down Expand Up @@ -31,6 +31,7 @@ linters:
- ineffassign
- interfacebloat
- makezero
- mirror
- misspell
- musttag
- nakedret
Expand All @@ -41,6 +42,7 @@ linters:
- reassign
- revive
- staticcheck
- tagalign
- tenv
- typecheck
- unconvert
Expand Down Expand Up @@ -71,6 +73,10 @@ linters-settings:
alias: observerpb
- pkg: github.com/cilium/cilium/api/v1/relay
alias: relaypb
revive:
rules:
- name: package-comments
disabled: true
issues:
# Default rules exclude Go doc comments check, which is rather unfortunate.
# In order to enable Go doc checks, defaults rules have to be disabled.
Expand All @@ -88,8 +94,6 @@ issues:
text: "G402" # TLS InsecureSkipVerify may be true
- linters: [gosec]
text: "G101" # Potential hardcoded credentials
- linters: [revive]
text: "should have a package comment"
- linters: [dupword]
path: cmd/list/node_test.go # tripping on command output
- linters: [dupword]
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func init() {
// Override the client so that it always returns an IOReaderObserver with no flows.
observe.GetHubbleClientFunc = func(_ context.Context, _ *viper.Viper) (client observerpb.ObserverClient, cleanup func() error, err error) {
cleanup = func() error { return nil }
return observe.NewIOReaderObserver(bytes.NewBuffer([]byte(``))), cleanup, nil
return observe.NewIOReaderObserver(new(bytes.Buffer)), cleanup, nil
}

expectedObserveHelp = fmt.Sprintf(expectedObserveHelp, defaults.ConfigFile)
Expand Down