Sync .golangci.yml from ENT (#17180)

This commit is contained in:
Semir Patel 2023-04-28 12:14:37 -05:00 committed by GitHub
parent eded58b62a
commit 1037bf7f69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 22 deletions

View File

@ -23,29 +23,14 @@ issues:
# Temp Ignore SA9004: only the first constant in this group has an explicit type
# https://staticcheck.io/docs/checks#SA9004
- linters: [staticcheck]
text: 'SA9004:'
- linters: [staticcheck]
text: 'SA1019: "github.com/golang/protobuf/jsonpb" is deprecated: Use the "google.golang.org/protobuf/encoding/protojson" package instead.'
- linters: [staticcheck]
text: 'SA1019: "github.com/golang/protobuf/proto" is deprecated: Use the "google.golang.org/protobuf/proto" package instead.'
- linters: [staticcheck]
text: 'SA1019: ptypes.MarshalAny is deprecated'
- linters: [staticcheck]
text: 'SA1019: ptypes.UnmarshalAny is deprecated'
- linters: [staticcheck]
text: 'SA1019: "github.com/golang/protobuf/ptypes" is deprecated: Well-known types have specialized functionality directly injected into the generated packages for each message type. See the deprecation notice for each function for the suggested alternative.'
text: "SA9004:"
- linters: [staticcheck]
text: 'SA1019: "io/ioutil" has been deprecated since Go 1.16'
# An argument that always receives the same value is often not a problem.
- linters: [unparam]
text: 'always receives'
text: "always receives"
# Often functions will implement an interface that returns an error without
# needing to return an error. Sometimes the error return value is unnecessary
@ -59,18 +44,18 @@ issues:
# self-documentation than a single underscore by itself. Underscore arguments
# should generally only be used when a function is implementing an interface.
- linters: [unparam]
text: '`_[^`]*` is unused'
text: "`_[^`]*` is unused"
# Temp ignore some common unused parameters so that unparam can be added
# incrementally.
- linters: [unparam]
text: '`(t|resp|req|entMeta)` is unused'
text: "`(t|resp|req|entMeta)` is unused"
# Temp ignore everything in _oss(_test).go and _ent(_test).go. Many of these
# could use underscore to ignore the unused arguments, but the "always returns"
# issue will likely remain in oss, and will need to be excluded.
- linters: [unparam]
path: '(_oss.go|_oss_test.go|_ent.go|_ent_test.go)'
path: "(_oss.go|_oss_test.go|_ent.go|_ent_test.go)"
linters-settings:
govet:
@ -115,7 +100,7 @@ linters-settings:
# Specify an error message to output when a denied package is used.
# Default: []
packages-with-error-message:
- net/rpc: 'only use forked copy in github.com/hashicorp/consul-net-rpc/net/rpc'
- net/rpc: "only use forked copy in github.com/hashicorp/consul-net-rpc/net/rpc"
run:
timeout: 10m

View File

@ -9,10 +9,10 @@ import (
"fmt"
"time"
"github.com/golang/protobuf/proto"
"github.com/oklog/ulid/v2"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/anypb"
"github.com/hashicorp/consul/acl"