Skip to content

Commit

Permalink
Use revive instead of golint
Browse files Browse the repository at this point in the history
Signed-off-by: pigletfly <[email protected]>
  • Loading branch information
pigletfly committed Apr 26, 2022
1 parent a23fffb commit ddc6177
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/components-contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
GOOS: ${{ matrix.target_os }}
GOARCH: ${{ matrix.target_arch }}
GOPROXY: https://proxy.golang.org
GOLANGCI_LINT_VER: v1.31
GOLANGCI_LINT_VER: v1.45.2
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
Expand Down
13 changes: 7 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ run:
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
skip-files:
# skip-files:
# - ".*\\.my\\.go$"
# - lib/bad.go

Expand Down Expand Up @@ -62,7 +62,7 @@ linters-settings:

# path to a file containing a list of functions to exclude from checking
# see https://github.com/kisielk/errcheck#excluding-functions for details
exclude:
# exclude:

funlen:
lines: 60
Expand All @@ -88,9 +88,9 @@ linters-settings:
disable:
- shadow
disable-all: false
golint:
revive:
# minimal confidence for issues, default is 0.8
min-confidence: 0.8
confidence: 0.8
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
Expand Down Expand Up @@ -127,7 +127,7 @@ linters-settings:
# Correct spellings using locale preferences for US or UK.
# Default is to use a neutral variety of English.
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
locale: default
locale: US
ignore-words:
- someword
lll:
Expand Down Expand Up @@ -165,7 +165,7 @@ linters-settings:
# See https://go-critic.github.io/overview#checks-overview
# To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`
# By default list of stable checks is used.
enabled-checks:
# enabled-checks:

# Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
disabled-checks:
Expand Down Expand Up @@ -246,3 +246,4 @@ linters:
- exhaustive
- noctx
- gci
- golint
2 changes: 1 addition & 1 deletion bindings/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
)

// HTTPSource is a binding for an http url endpoint invocation
// nolint:golint
//revive:disable-next-line
type HTTPSource struct {
metadata httpMetadata
client *http.Client
Expand Down
1 change: 0 additions & 1 deletion lock/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ limitations under the License.
package lock

type Store interface {

// Init this component.
InitLockStore(metadata Metadata) error

Expand Down
13 changes: 7 additions & 6 deletions nameresolution/consul/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func mapAdvancedRegistration(config *AgentServiceRegistration) *consul.AgentServ
return mapped
}

//nolint:golint,stylecheck
//revive:disable-next-line
type HttpBasicAuth struct {
Username string
Password string
Expand All @@ -337,11 +337,12 @@ type Config struct {
Address string
Scheme string
Datacenter string
HttpAuth *HttpBasicAuth //nolint:golint,stylecheck
WaitTime time.Duration
Token string
TokenFile string
TLSConfig TLSConfig
//revive:disable-next-line
HttpAuth *HttpBasicAuth
WaitTime time.Duration
Token string
TokenFile string
TLSConfig TLSConfig
}

type TLSConfig struct {
Expand Down
1 change: 0 additions & 1 deletion pubsub/azure/servicebus/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ func NewPubsubMessageFromASBMessage(asbMsg *azservicebus.Message, topic string)
// Always set delivery count.
addToMetadata(pubsubMsg, DeliveryCountMetadataKey, strconv.FormatInt(int64(asbMsg.DeliveryCount), 10))

//nolint:golint,nestif
if asbMsg.SystemProperties != nil {
systemProps := asbMsg.SystemProperties
if systemProps.EnqueuedTime != nil {
Expand Down
1 change: 0 additions & 1 deletion state/redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@ func (r *StateStore) Multi(request *state.TransactionalStateRequest) error {

pipe := r.client.TxPipeline()
for _, o := range request.Operations {
//nolint:golint,nestif
if o.Operation == state.Upsert {
req := o.Request.(state.SetRequest)
ver, err := r.parseETag(&req)
Expand Down

0 comments on commit ddc6177

Please sign in to comment.