Skip to content

Commit

Permalink
Bump golangci-lint and add linters (#2382)
Browse files Browse the repository at this point in the history
* Update golangci-lint

* Remove unused nolint

* Add UseTesting linter

* Add nilnesserr linter
  • Loading branch information
AnkushinDaniil authored Jan 17, 2025
1 parent fdedeb8 commit 0c9ee5a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ linters:
- tparallel
- gci
- exhaustruct
- usetesting
- nilnesserr

# don't enable:
# - asciicheck
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ install-mockgen:
go install go.uber.org/mock/mockgen@latest

install-golangci-lint:
@which golangci-lint || go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
@which golangci-lint || go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.63.4

lint: install-golangci-lint ## Run linter
golangci-lint run
Expand Down
2 changes: 1 addition & 1 deletion vm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ func (v *vm) Execute(txns []core.Transaction, declaredClasses []core.Class, paid
return context.actualFees, context.daGas, traces, context.executionSteps, nil
}

func marshalTxnsAndDeclaredClasses(txns []core.Transaction, declaredClasses []core.Class) (json.RawMessage, json.RawMessage, error) { //nolint:lll
func marshalTxnsAndDeclaredClasses(txns []core.Transaction, declaredClasses []core.Class) (json.RawMessage, json.RawMessage, error) {
txnJSONs := make([]json.RawMessage, 0, len(txns))
for _, txn := range txns {
txnJSON, err := marshalTxn(txn)
Expand Down
2 changes: 1 addition & 1 deletion vm/vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func TestSetVersionedConstants(t *testing.T) {
assert.NoError(t, err)
})
t.Run("not valid json", func(t *testing.T) {
fd, err := os.CreateTemp("", "versioned_constants_test*")
fd, err := os.CreateTemp(t.TempDir(), "versioned_constants_test*")
require.NoError(t, err)
defer os.Remove(fd.Name())

Expand Down

0 comments on commit 0c9ee5a

Please sign in to comment.