From d13ccfb4f30300aaffe19a683d987c1c22dc6746 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Fri, 23 Feb 2024 18:47:08 +0100 Subject: [PATCH 1/3] Check goimports in golangci-lint --- .golangci.yml | 10 ++++++++++ Makefile | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 000000000..3af894222 --- /dev/null +++ b/.golangci.yml @@ -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 diff --git a/Makefile b/Makefile index 0f84c83aa..03b4d0843 100644 --- a/Makefile +++ b/Makefile @@ -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 From 4eaf029ea86d7c4840b325fcbea098445c6c0159 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Fri, 23 Feb 2024 18:58:35 +0100 Subject: [PATCH 2/3] Update golangci-lint to v1.56.2 --- .github/workflows/lint-go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-go.yml b/.github/workflows/lint-go.yml index b0a2065f9..c6bd3e5bb 100644 --- a/.github/workflows/lint-go.yml +++ b/.github/workflows/lint-go.yml @@ -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 From eb4fb669f5bab48be64a08bd0cb60bb4f471cd97 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Fri, 23 Feb 2024 19:12:57 +0100 Subject: [PATCH 3/3] Fix go import formatting --- lib_no_cgo_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_no_cgo_test.go b/lib_no_cgo_test.go index 8998df7d7..3cc5cf916 100644 --- a/lib_no_cgo_test.go +++ b/lib_no_cgo_test.go @@ -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) {