Skip to content

Commit

Permalink
chore(golang-ci): upgrade golangci-lint to v1.45 (#2434)
Browse files Browse the repository at this point in the history
* chore(golang-ci): upgrade `golangci-lint` to `v1.45`

* Update server_test.go

* Update resolver.go

* Update test_helpers.go

* Update imports.go

* Update grandpa.go

* Update helpers.go

* chore: comment not supported lint rules and add nolintlint exclude rule

* chore: improve exclude rule

* chore: remove unused `//nolint`
  • Loading branch information
EclesioMeloJunior authored Mar 25, 2022
1 parent c04d185 commit afb2151
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ help: Makefile

.PHONY: lint
lint:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.44
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45
golangci-lint run --build-tags integration --timeout 10m

clean:
Expand Down
2 changes: 1 addition & 1 deletion dot/rpc/modules/grandpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (gm *GrandpaModule) ProveFinality(r *http.Request, req *ProveFinalityReques
}

// Leaving check in for linter
if req.authorityID != uint64(0) { // nolint:staticcheck
if req.authorityID != uint64(0) {
// TODO: Check if functionality relevant (#1404)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/pprof/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func Test_Server(t *testing.T) {
require.NoError(t, err)

go func(client *http.Client, request *http.Request, results chan<- httpResult) {
response, err := client.Do(request) //nolint:bodyclose
response, err := client.Do(request)
results <- httpResult{
url: request.URL.String(),
response: response,
Expand Down
2 changes: 1 addition & 1 deletion lib/runtime/life/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ func storageAppend(storage runtime.Storage, key, valueToAppend []byte) error {
if err != nil {
logger.Tracef("item in storage is not SCALE encoded, overwriting at key 0x%x", key)
storage.Set(key, append([]byte{4}, valueToAppend...))
return nil //nolint:nilerr
return nil
}

lengthBytes, err := scale.Marshal(currLength)
Expand Down
2 changes: 1 addition & 1 deletion lib/runtime/life/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
var DefaultTestLogLvl = log.Info

// newTestInstance will create a new runtime instance using the given target runtime
func newTestInstance(t *testing.T, targetRuntime string) *Instance { //nolint:unparam
func newTestInstance(t *testing.T, targetRuntime string) *Instance {
return newTestInstanceWithTrie(t, runtime.HOST_API_TEST_RUNTIME, nil, DefaultTestLogLvl)
}

Expand Down
2 changes: 1 addition & 1 deletion lib/runtime/wasmer/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,7 @@ func storageAppend(storage runtime.Storage, key, valueToAppend []byte) error {
logger.Tracef(
"item in storage is not SCALE encoded, overwriting at key 0x%x", key)
storage.Set(key, append([]byte{4}, valueToAppend...))
return nil //nolint:nilerr
return nil
}

lengthBytes, err := scale.Marshal(currLength)
Expand Down
1 change: 0 additions & 1 deletion tests/stress/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ func compareFinalizedHeadsWithRetry(t *testing.T, nodes []*utils.Node, round uin
return common.Hash{}, nil
}

//nolint
func getPendingExtrinsics(t *testing.T, node *utils.Node) []string {
respBody, err := utils.PostRPC(utils.AuthorPendingExtrinsics, utils.NewEndpoint(node.RPCPort), "[]")
require.NoError(t, err)
Expand Down

0 comments on commit afb2151

Please sign in to comment.