Skip to content

Commit

Permalink
Merge pull request #521 from CosmWasm/format-in-lint
Browse files Browse the repository at this point in the history
Check goimports in golangci-lint
  • Loading branch information
webmaster128 committed Feb 26, 2024
2 parents 5f77f8d + eb4fb66 commit b381d14
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.55.2
version: v1.56.2

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
10 changes: 10 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
linters:
# Enable specific linter
# https://golangci-lint.run/usage/linters/#enabled-by-default
enable:
- gofumpt
- goimports

linters-settings:
goimports:
local-prefixes: github.com/CosmWasm/wasmvm
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,11 @@ test-alpine: release-build-alpine create-tester-image
format:
find . -name '*.go' -type f | xargs gofumpt -w -s
find . -name '*.go' -type f | xargs misspell -w
find . -name '*.go' -type f | xargs goimports -w -local github.com/CosmWasm/wasmvm

.PHONY: lint
lint:
golangci-lint run

.PHONY: lint-fix
lint-fix:
golangci-lint run --fix
3 changes: 2 additions & 1 deletion lib_no_cgo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package cosmwasm
import (
"testing"

"github.com/CosmWasm/wasmvm/v2/types"
"github.com/stretchr/testify/require"

"github.com/CosmWasm/wasmvm/v2/types"
)

func TestCreateChecksum(t *testing.T) {
Expand Down

0 comments on commit b381d14

Please sign in to comment.