Skip to content

Commit

Permalink
update linter
Browse files Browse the repository at this point in the history
  • Loading branch information
javiersuweijie committed Feb 19, 2024
1 parent a9c53b2 commit b0be354
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.52.2
version: v1.54.2
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ run:
linters:
disable-all: true
enable:
- depguard
- dogsled
- errcheck
- exportloopref
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ format-tools:
go install mvdan.cc/[email protected]
go install github.com/client9/misspell/cmd/[email protected]
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2

lint: format-tools
golangci-lint run
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "*.pb.go" -not -path "*pb.gw.go" | xargs gofumpt -d

lint-docker:
docker run --rm -v $(PWD):/app -w /app golangci/golangci-lint:v1.52.2-alpine golangci-lint run --timeout 10m
docker run --rm -v $(PWD):/app -w /app golangci/golangci-lint:v1.54.2-alpine golangci-lint run --timeout 10m

format: format-tools
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "*.pb.go" -not -path "*pb.gw.go" | xargs gofumpt -w
Expand Down
10 changes: 5 additions & 5 deletions x/alliance/bindings/query_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ func (q *QueryPlugin) GetAlliance(ctx sdk.Context, denom string) (res []byte, er
func (q *QueryPlugin) GetDelegation(ctx sdk.Context, denom string, delegator string, validator string) (res []byte, err error) {
delegatorAddr, err := sdk.AccAddressFromBech32(delegator)
if err != nil {
return
return nil, err
}
validatorAddr, err := sdk.ValAddressFromBech32(validator)
if err != nil {
return
return nil, err
}
delegation, found := q.allianceKeeper.GetDelegation(ctx, delegatorAddr, validatorAddr, denom)
if !found {
Expand Down Expand Up @@ -117,11 +117,11 @@ func (q *QueryPlugin) GetDelegationRewards(ctx sdk.Context,
) (res []byte, err error) {
delegatorAddr, err := sdk.AccAddressFromBech32(delegator)
if err != nil {
return
return nil, err
}
validatorAddr, err := sdk.ValAddressFromBech32(validator)
if err != nil {
return
return nil, err
}
delegation, found := q.allianceKeeper.GetDelegation(ctx, delegatorAddr, validatorAddr, denom)
if !found {
Expand All @@ -138,7 +138,7 @@ func (q *QueryPlugin) GetDelegationRewards(ctx sdk.Context,

rewards, _, err := q.allianceKeeper.CalculateDelegationRewards(ctx, delegation, allianceValidator, asset)
if err != nil {
return
return nil, err
}

var coins []types.Coin
Expand Down

0 comments on commit b0be354

Please sign in to comment.