Skip to content

Commit

Permalink
Enable few more linters in golangci-lint (dapr#668)
Browse files Browse the repository at this point in the history
* Enabled gofmt and goimports

* Correct goimports

* testing for win

* :)

* Install the tools

* Install the tools

* Install the tools

* Fixed for windows for gofmt and goimports

* Enabled unused

* Enabled deadcode

* Enabled golint

* Removed skipped file config

* Incorporate review comments
  • Loading branch information
sayboras authored and yaron2 committed Oct 24, 2019
1 parent bc143c7 commit e3158b7
Show file tree
Hide file tree
Showing 15 changed files with 235 additions and 260 deletions.
11 changes: 1 addition & 10 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ run:
skip-files:
# - ".*\\.my\\.go$"
# - lib/bad.go
- pkg.*version.*version.go
- pkg.*models.*models.go
- pkg.*config.*modes.*kubernetes_config.go

# output configuration options
output:
Expand Down Expand Up @@ -102,7 +99,7 @@ linters-settings:
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: github.com/dapr/dapr
local-prefixes:
gocyclo:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 10
Expand Down Expand Up @@ -222,7 +219,6 @@ linters:
enable-all: true
disable:
# TODO Enforce the below linters later
- deadcode
- dupl
- errcheck
- funlen
Expand All @@ -231,14 +227,9 @@ linters:
- gocyclo
- gocognit
- godox
- golint
# TODO enable gofmt and goimports again once github action is done. Now both failed in windows only.
- gofmt
- goimports
- interfacer
- lll
- maligned
- scopelint
- unparam
- unused
- wsl
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,5 @@ test:
################################################################################
.PHONY: lint
lint:
$(GOLANGCI_LINT) run
# Due to https://github.com/golangci/golangci-lint/issues/580, we need to add --fix for windows
$(GOLANGCI_LINT) run --fix
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/components-contrib v0.0.0-20191014200624-99461da9580e h1:IjFWdathj1+u5tbtU+GLvtqw2uDJNeIh7lRwWo4IKoc=
github.com/dapr/components-contrib v0.0.0-20191014200624-99461da9580e/go.mod h1:7YLneZG5RQOCoagWAg6ZHEEQAl0njGOmlsFwt6PWLbg=
github.com/dapr/components-contrib v0.0.0-20191022213015-63af15926ba3 h1:vXzgqc2v0LJoLW+nkrxWdnyYk8jB1OggJL3WLPJbQGU=
github.com/dapr/components-contrib v0.0.0-20191022213015-63af15926ba3/go.mod h1:APCNBRpSaDDw/KNmwwadWdpQwlL2GYNH4T1TlYIyFcg=
github.com/dapr/components-contrib v0.0.0-20191023150805-c57cb043af80 h1:1J9kGPVw6YmYHdC34rCUsveGZltrIeDlrhMLitxYUyM=
github.com/dapr/components-contrib v0.0.0-20191023150805-c57cb043af80/go.mod h1:3ad1Z9F+U7TD50/joD6Jg409HG5ebKrR1YGvcUSwhiA=
Expand Down
4 changes: 2 additions & 2 deletions pkg/actors/actors.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type actorsRuntime struct {
appChannel channel.AppChannel
store state.StateStore
placementTableLock *sync.RWMutex
placementTables *placement.PlacementTables
placementTables *placement.ConsistentHashTables
placementSignal chan struct{}
placementBlock bool
operationUpdateLock *sync.Mutex
Expand Down Expand Up @@ -80,7 +80,7 @@ func NewActors(stateStore state.StateStore, appChannel channel.AppChannel, grpcC
config: config,
store: stateStore,
placementTableLock: &sync.RWMutex{},
placementTables: &placement.PlacementTables{Entries: make(map[string]*placement.Consistent)},
placementTables: &placement.ConsistentHashTables{Entries: make(map[string]*placement.Consistent)},
operationUpdateLock: &sync.Mutex{},
grpcConnectionFn: grpcConnectionFn,
actorsTable: &sync.Map{},
Expand Down
Loading

0 comments on commit e3158b7

Please sign in to comment.