Skip to content

Commit

Permalink
gci is much better than goimports
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat committed Dec 22, 2024
1 parent 64e241e commit 675f892
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 11 deletions.
27 changes: 27 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions ibc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion internal/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion internal/api/iterator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion internal/api/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion internal/api/lib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
5 changes: 3 additions & 2 deletions internal/api/mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 **/
Expand Down
5 changes: 3 additions & 2 deletions lib_libwasmvm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion lib_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 675f892

Please sign in to comment.