Skip to content

Commit

Permalink
ci: enable new linters
Browse files Browse the repository at this point in the history
While here, cleanup the golangci-lint config.

Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
  • Loading branch information
rolinh committed Jun 2, 2023
1 parent 89db7a9 commit aef1d3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
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

0 comments on commit aef1d3f

Please sign in to comment.