Skip to content

Commit 675f892

Browse files
committed
gci is much better than goimports
1 parent 64e241e commit 675f892

File tree

9 files changed

+46
-11
lines changed

9 files changed

+46
-11
lines changed

.golangci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,33 @@ linters:
99
- gci
1010
- testifylint
1111

12+
linters-settings:
13+
gci:
14+
# Section configuration to compare against.
15+
# Section names are case-insensitive and may contain parameters in ().
16+
# The default order of sections is `standard > default > custom > blank > dot > alias > localmodule`,
17+
# If `custom-order` is `true`, it follows the order of `sections` option.
18+
# Default: ["standard", "default"]
19+
sections:
20+
- standard # Standard section: captures all standard packages.
21+
- default # Default section: contains all imports that could not be matched to another section type.
22+
- prefix(github.com/cosmos/cosmos-sdk) # Custom section: groups all imports with the specified Prefix.
23+
- prefix(github.com/cosmos/ibc-go)
24+
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
25+
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
26+
- alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled.
27+
- localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
28+
# Skip generated files.
29+
# Default: true
30+
skip-generated: false
31+
# Enable custom order of sections.
32+
# If `true`, make the section order the same as the order of `sections`.
33+
# Default: false
34+
custom-order: true
35+
# Drops lexical ordering for custom sections.
36+
# Default: false
37+
no-lex-order: true
38+
1239
issues:
1340
max-issues-per-linter: 0
1441
max-same-issues: 0

ibc_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ import (
77
"os"
88
"testing"
99

10-
"github.com/CosmWasm/wasmvm/v2/internal/api"
11-
"github.com/CosmWasm/wasmvm/v2/types"
1210
"github.com/stretchr/testify/assert"
1311
"github.com/stretchr/testify/require"
12+
13+
"github.com/CosmWasm/wasmvm/v2/internal/api"
14+
"github.com/CosmWasm/wasmvm/v2/types"
1415
)
1516

1617
const IBC_TEST_CONTRACT = "./testdata/ibc_reflect.wasm"

internal/api/api_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import (
55
"os"
66
"testing"
77

8-
"github.com/CosmWasm/wasmvm/v2/types"
98
"github.com/stretchr/testify/require"
9+
10+
"github.com/CosmWasm/wasmvm/v2/types"
1011
)
1112

1213
func TestValidateAddressFailure(t *testing.T) {

internal/api/iterator_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ import (
66
"sync"
77
"testing"
88

9+
"github.com/stretchr/testify/require"
10+
911
"github.com/CosmWasm/wasmvm/v2/internal/api/testdb"
1012
"github.com/CosmWasm/wasmvm/v2/types"
11-
"github.com/stretchr/testify/require"
1213
)
1314

1415
type queueData struct {

internal/api/lib.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ import (
1313
"strings"
1414
"syscall"
1515

16-
"github.com/CosmWasm/wasmvm/v2/types"
1716
"golang.org/x/sys/unix"
17+
18+
"github.com/CosmWasm/wasmvm/v2/types"
1819
)
1920

2021
// Value types

internal/api/lib_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ import (
1313
"testing"
1414
"time"
1515

16-
"github.com/CosmWasm/wasmvm/v2/types"
1716
"github.com/stretchr/testify/assert"
1817
"github.com/stretchr/testify/require"
18+
19+
"github.com/CosmWasm/wasmvm/v2/types"
1920
)
2021

2122
const (

internal/api/mocks.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ import (
88
"strings"
99
"testing"
1010

11-
"github.com/CosmWasm/wasmvm/v2/internal/api/testdb"
12-
"github.com/CosmWasm/wasmvm/v2/types"
1311
"github.com/stretchr/testify/assert"
1412
"github.com/stretchr/testify/require"
13+
14+
"github.com/CosmWasm/wasmvm/v2/internal/api/testdb"
15+
"github.com/CosmWasm/wasmvm/v2/types"
1516
)
1617

1718
/** helper constructors **/

lib_libwasmvm_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ import (
99
"os"
1010
"testing"
1111

12-
"github.com/CosmWasm/wasmvm/v2/internal/api"
13-
"github.com/CosmWasm/wasmvm/v2/types"
1412
"github.com/stretchr/testify/assert"
1513
"github.com/stretchr/testify/require"
14+
15+
"github.com/CosmWasm/wasmvm/v2/internal/api"
16+
"github.com/CosmWasm/wasmvm/v2/types"
1617
)
1718

1819
const (

lib_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ package cosmwasm
33
import (
44
"testing"
55

6-
"github.com/CosmWasm/wasmvm/v2/types"
76
"github.com/stretchr/testify/require"
7+
8+
"github.com/CosmWasm/wasmvm/v2/types"
89
)
910

1011
func TestCreateChecksum(t *testing.T) {

0 commit comments

Comments
 (0)