From 675f892664417aff323568d8499d03dd9cacd32c Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Sun, 22 Dec 2024 19:33:56 +0700 Subject: [PATCH] gci is much better than goimports --- .golangci.yml | 27 +++++++++++++++++++++++++++ ibc_test.go | 5 +++-- internal/api/api_test.go | 3 ++- internal/api/iterator_test.go | 3 ++- internal/api/lib.go | 3 ++- internal/api/lib_test.go | 3 ++- internal/api/mocks.go | 5 +++-- lib_libwasmvm_test.go | 5 +++-- lib_test.go | 3 ++- 9 files changed, 46 insertions(+), 11 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 8ba457557..a1be8e233 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -9,6 +9,33 @@ linters: - gci - testifylint +linters-settings: + gci: + # Section configuration to compare against. + # Section names are case-insensitive and may contain parameters in (). + # The default order of sections is `standard > default > custom > blank > dot > alias > localmodule`, + # If `custom-order` is `true`, it follows the order of `sections` option. + # Default: ["standard", "default"] + sections: + - standard # Standard section: captures all standard packages. + - default # Default section: contains all imports that could not be matched to another section type. + - prefix(github.com/cosmos/cosmos-sdk) # Custom section: groups all imports with the specified Prefix. + - prefix(github.com/cosmos/ibc-go) + - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled. + - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled. + - alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled. + - localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled. + # Skip generated files. + # Default: true + skip-generated: false + # Enable custom order of sections. + # If `true`, make the section order the same as the order of `sections`. + # Default: false + custom-order: true + # Drops lexical ordering for custom sections. + # Default: false + no-lex-order: true + issues: max-issues-per-linter: 0 max-same-issues: 0 diff --git a/ibc_test.go b/ibc_test.go index d095871aa..76987c9cc 100644 --- a/ibc_test.go +++ b/ibc_test.go @@ -7,10 +7,11 @@ import ( "os" "testing" - "github.com/CosmWasm/wasmvm/v2/internal/api" - "github.com/CosmWasm/wasmvm/v2/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/CosmWasm/wasmvm/v2/internal/api" + "github.com/CosmWasm/wasmvm/v2/types" ) const IBC_TEST_CONTRACT = "./testdata/ibc_reflect.wasm" diff --git a/internal/api/api_test.go b/internal/api/api_test.go index 7b6c6eec1..1d8109857 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -5,8 +5,9 @@ import ( "os" "testing" - "github.com/CosmWasm/wasmvm/v2/types" "github.com/stretchr/testify/require" + + "github.com/CosmWasm/wasmvm/v2/types" ) func TestValidateAddressFailure(t *testing.T) { diff --git a/internal/api/iterator_test.go b/internal/api/iterator_test.go index d5912338e..bcf2b6290 100644 --- a/internal/api/iterator_test.go +++ b/internal/api/iterator_test.go @@ -6,9 +6,10 @@ import ( "sync" "testing" + "github.com/stretchr/testify/require" + "github.com/CosmWasm/wasmvm/v2/internal/api/testdb" "github.com/CosmWasm/wasmvm/v2/types" - "github.com/stretchr/testify/require" ) type queueData struct { diff --git a/internal/api/lib.go b/internal/api/lib.go index 73a922930..2b71adc1c 100644 --- a/internal/api/lib.go +++ b/internal/api/lib.go @@ -13,8 +13,9 @@ import ( "strings" "syscall" - "github.com/CosmWasm/wasmvm/v2/types" "golang.org/x/sys/unix" + + "github.com/CosmWasm/wasmvm/v2/types" ) // Value types diff --git a/internal/api/lib_test.go b/internal/api/lib_test.go index ccb0b7c02..706690202 100644 --- a/internal/api/lib_test.go +++ b/internal/api/lib_test.go @@ -13,9 +13,10 @@ import ( "testing" "time" - "github.com/CosmWasm/wasmvm/v2/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/CosmWasm/wasmvm/v2/types" ) const ( diff --git a/internal/api/mocks.go b/internal/api/mocks.go index c7043f208..ba64aaabc 100644 --- a/internal/api/mocks.go +++ b/internal/api/mocks.go @@ -8,10 +8,11 @@ import ( "strings" "testing" - "github.com/CosmWasm/wasmvm/v2/internal/api/testdb" - "github.com/CosmWasm/wasmvm/v2/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/CosmWasm/wasmvm/v2/internal/api/testdb" + "github.com/CosmWasm/wasmvm/v2/types" ) /** helper constructors **/ diff --git a/lib_libwasmvm_test.go b/lib_libwasmvm_test.go index 8633f7036..15b587fec 100644 --- a/lib_libwasmvm_test.go +++ b/lib_libwasmvm_test.go @@ -9,10 +9,11 @@ import ( "os" "testing" - "github.com/CosmWasm/wasmvm/v2/internal/api" - "github.com/CosmWasm/wasmvm/v2/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/CosmWasm/wasmvm/v2/internal/api" + "github.com/CosmWasm/wasmvm/v2/types" ) const ( diff --git a/lib_test.go b/lib_test.go index 54b2d3293..35094e7df 100644 --- a/lib_test.go +++ b/lib_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) {