Skip to content

Commit

Permalink
chore: fix imports order
Browse files Browse the repository at this point in the history
  • Loading branch information
omissis committed Sep 8, 2022
1 parent 4944cfb commit 88d2cdf
Show file tree
Hide file tree
Showing 20 changed files with 61 additions and 55 deletions.
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ mod-check-upgrades:
mod-upgrade:
@go get -u ./... && go mod tidy

.PHONY: fmt fumpt imports
.PHONY: fmt fumpt imports gci

fmt:
@find . -name "*.go" -type f -not -path '*/vendor/*' \
Expand All @@ -60,9 +60,15 @@ fumpt:
| xargs -I {} sh -c 'echo "formatting {}.." && gofumpt -w -extra {}'

imports:
@goimports -w -e -local github.com/omissis main.go
@goimports -w -e -local github.com/omissis cmd/
@goimports -w -e -local github.com/omissis internal/
@goimports -v -w -e -local github.com/omissis main.go
@goimports -v -w -e -local github.com/omissis cmd/
@goimports -v -w -e -local github.com/omissis internal/

gci:
@find . -name "*.go" -type f -not -path '*/vendor/*' \
| sed 's/^\.\///g' \
| xargs -I {} sh -c 'echo "formatting imports for {}.." && \
gci write --skip-generated -s standard -s default -s "prefix(github.com/omissis)" {}'

.PHONY: lint lint-go

Expand Down
1 change: 1 addition & 0 deletions cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func listConfigFiles(cfs []string) []string {

if !fileInfo.IsDir() {
configFiles = append(configFiles, cf)

continue
}

Expand Down
6 changes: 3 additions & 3 deletions internal/arch/file/except/this_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package except_test
import (
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

"github.com/omissis/goarkitect/internal/arch/file"
"github.com/omissis/goarkitect/internal/arch/file/except"
"github.com/omissis/goarkitect/internal/arch/rule"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)

func Test_This(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/arch/file/expect/be_gitencrypted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"path/filepath"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

"github.com/omissis/goarkitect/internal/arch/file"
"github.com/omissis/goarkitect/internal/arch/file/expect"
"github.com/omissis/goarkitect/internal/arch/rule"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)

func Test_BeGitencrypted(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/arch/file/expect/be_gitignored_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"path/filepath"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

"github.com/omissis/goarkitect/internal/arch/file"
"github.com/omissis/goarkitect/internal/arch/file/expect"
"github.com/omissis/goarkitect/internal/arch/rule"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)

func Test_BeGitignored(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/arch/file/expect/contain_value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"path/filepath"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

"github.com/omissis/goarkitect/internal/arch/file"
"github.com/omissis/goarkitect/internal/arch/file/expect"
"github.com/omissis/goarkitect/internal/arch/rule"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)

func Test_ContainValue(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/arch/file/expect/end_with_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package expect_test
import (
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

"github.com/omissis/goarkitect/internal/arch/file"
"github.com/omissis/goarkitect/internal/arch/file/expect"
"github.com/omissis/goarkitect/internal/arch/rule"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)

func Test_EndWith(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/arch/file/expect/exist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package expect_test
import (
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

"github.com/omissis/goarkitect/internal/arch/file"
"github.com/omissis/goarkitect/internal/arch/file/expect"
"github.com/omissis/goarkitect/internal/arch/rule"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)

func Test_Exist(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions internal/arch/file/expect/have_content_matching.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"os"
"path/filepath"

"github.com/omissis/goarkitect/internal/arch/rule"

"golang.org/x/exp/slices"

"github.com/omissis/goarkitect/internal/arch/rule"
)

func HaveContentMatching(value []byte, opts ...Option) *haveContentMatchingExpression {
Expand Down
6 changes: 3 additions & 3 deletions internal/arch/file/expect/have_content_matching_regex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"path/filepath"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

"github.com/omissis/goarkitect/internal/arch/file"
"github.com/omissis/goarkitect/internal/arch/file/expect"
"github.com/omissis/goarkitect/internal/arch/rule"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)

func Test_HaveContentMatchingRegex(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/arch/file/expect/have_content_matching_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"path/filepath"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

"github.com/omissis/goarkitect/internal/arch/file"
"github.com/omissis/goarkitect/internal/arch/file/expect"
"github.com/omissis/goarkitect/internal/arch/rule"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)

func Test_HaveContentMatching(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/arch/file/expect/have_permissions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"path/filepath"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

"github.com/omissis/goarkitect/internal/arch/file"
"github.com/omissis/goarkitect/internal/arch/file/expect"
"github.com/omissis/goarkitect/internal/arch/rule"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)

func Test_HavePermissions(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/arch/file/expect/match_glob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"path/filepath"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

"github.com/omissis/goarkitect/internal/arch/file"
"github.com/omissis/goarkitect/internal/arch/file/expect"
"github.com/omissis/goarkitect/internal/arch/rule"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)

func Test_MatchGlob(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/arch/file/expect/match_regex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package expect_test
import (
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

"github.com/omissis/goarkitect/internal/arch/file"
"github.com/omissis/goarkitect/internal/arch/file/expect"
"github.com/omissis/goarkitect/internal/arch/rule"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)

func Test_MatchRegex(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/arch/file/expect/start_with_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package expect_test
import (
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

"github.com/omissis/goarkitect/internal/arch/file"
"github.com/omissis/goarkitect/internal/arch/file/expect"
"github.com/omissis/goarkitect/internal/arch/rule"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)

func Test_StartWith(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/arch/file/rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package file_test
import (
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

"github.com/omissis/goarkitect/internal/arch/file"
fe "github.com/omissis/goarkitect/internal/arch/file/except"
fs "github.com/omissis/goarkitect/internal/arch/file/expect"
ft "github.com/omissis/goarkitect/internal/arch/file/that"
"github.com/omissis/goarkitect/internal/arch/rule"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)

func Test_It_Checks_All_Conditions(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/arch/file/that/are_in_folder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package that_test
import (
"testing"

"github.com/omissis/goarkitect/internal/arch/file"
"github.com/omissis/goarkitect/internal/arch/file/that"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

"github.com/omissis/goarkitect/internal/arch/file"
"github.com/omissis/goarkitect/internal/arch/file/that"
)

func Test_AreInFolder(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/arch/file/that/end_with_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package that_test
import (
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

"github.com/omissis/goarkitect/internal/arch/file"
"github.com/omissis/goarkitect/internal/arch/file/that"
"github.com/omissis/goarkitect/internal/arch/rule"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)

func Test_EndWith(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions internal/config/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import (
"fmt"

"github.com/omissis/goarkitect/internal/arch/file"
"github.com/omissis/goarkitect/internal/arch/rule"

fe "github.com/omissis/goarkitect/internal/arch/file/except"
fs "github.com/omissis/goarkitect/internal/arch/file/expect"
ft "github.com/omissis/goarkitect/internal/arch/file/that"
"github.com/omissis/goarkitect/internal/arch/rule"
)

type Root struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/schema/santhosh/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package santhosh_test
import (
"testing"

"github.com/omissis/goarkitect/internal/schema/santhosh"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/santhosh-tekuri/jsonschema"

"github.com/omissis/goarkitect/internal/schema/santhosh"
)

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

0 comments on commit 88d2cdf

Please sign in to comment.