diff --git a/Makefile b/Makefile index 5303898..fa07b8f 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ -.PHONY: all test test-color coverage coverage-cli coverate-html lint build +.PHONY: all test test-color coverage coverage-cli coverate-html lint format build -all: test-color lint +all: test-color lint format go mod tidy test: @@ -22,5 +22,11 @@ coverage-html: coverage lint: golangci-lint run ./... +format: + go install github.com/haunt98/gofimports/cmd/gofimports@latest + go install mvdan.cc/gofumpt@latest + gofimports -w -company github.com/make-go-great . + gofumpt -w -extra . + build: go build -o changeloguru-dev ./cmd/changeloguru diff --git a/internal/changelog/filter_test.go b/internal/changelog/filter_test.go index 1afef85..b23aa2b 100644 --- a/internal/changelog/filter_test.go +++ b/internal/changelog/filter_test.go @@ -3,8 +3,9 @@ package changelog import ( "testing" - "github.com/haunt98/changeloguru/internal/convention" "github.com/stretchr/testify/assert" + + "github.com/haunt98/changeloguru/internal/convention" ) func TestFilter(t *testing.T) { diff --git a/internal/changelog/markdown.go b/internal/changelog/markdown.go index ff1e955..14899f5 100644 --- a/internal/changelog/markdown.go +++ b/internal/changelog/markdown.go @@ -4,8 +4,9 @@ import ( "strings" "time" - "github.com/haunt98/changeloguru/internal/convention" "github.com/make-go-great/markdown-go" + + "github.com/haunt98/changeloguru/internal/convention" ) const ( diff --git a/internal/changelog/markdown_test.go b/internal/changelog/markdown_test.go index 3364edd..e546168 100644 --- a/internal/changelog/markdown_test.go +++ b/internal/changelog/markdown_test.go @@ -4,9 +4,11 @@ import ( "testing" "time" - "github.com/haunt98/changeloguru/internal/convention" - "github.com/make-go-great/markdown-go" "github.com/sebdah/goldie/v2" + + "github.com/make-go-great/markdown-go" + + "github.com/haunt98/changeloguru/internal/convention" ) func TestGenerateMarkdown(t *testing.T) { diff --git a/internal/changelog/rst.go b/internal/changelog/rst.go index 22c9529..d45be9b 100644 --- a/internal/changelog/rst.go +++ b/internal/changelog/rst.go @@ -4,8 +4,9 @@ import ( "strings" "time" - "github.com/haunt98/changeloguru/internal/convention" "github.com/make-go-great/rst-go" + + "github.com/haunt98/changeloguru/internal/convention" ) // GenerateRST base on GenerateMarkdown diff --git a/internal/changelog/rst_test.go b/internal/changelog/rst_test.go index 8f9f708..3c8a1f5 100644 --- a/internal/changelog/rst_test.go +++ b/internal/changelog/rst_test.go @@ -4,9 +4,11 @@ import ( "testing" "time" - "github.com/haunt98/changeloguru/internal/convention" - "github.com/make-go-great/rst-go" "github.com/sebdah/goldie/v2" + + "github.com/make-go-great/rst-go" + + "github.com/haunt98/changeloguru/internal/convention" ) func TestGenerateRST(t *testing.T) { diff --git a/internal/cli/action_generate.go b/internal/cli/action_generate.go index 8c8d46f..9595063 100644 --- a/internal/cli/action_generate.go +++ b/internal/cli/action_generate.go @@ -9,16 +9,18 @@ import ( "strings" "time" - "github.com/haunt98/changeloguru/internal/changelog" - "github.com/haunt98/changeloguru/internal/convention" - "github.com/haunt98/changeloguru/internal/git" - "github.com/make-go-great/ioe-go" - "github.com/make-go-great/markdown-go" - "github.com/make-go-great/rst-go" "github.com/pkg/diff" "github.com/pkg/diff/write" "github.com/urfave/cli/v2" "golang.org/x/mod/semver" + + "github.com/make-go-great/ioe-go" + "github.com/make-go-great/markdown-go" + "github.com/make-go-great/rst-go" + + "github.com/haunt98/changeloguru/internal/changelog" + "github.com/haunt98/changeloguru/internal/convention" + "github.com/haunt98/changeloguru/internal/git" ) const autoCommitMessageTemplate = "chore(changelog): generate %s" diff --git a/internal/cli/app.go b/internal/cli/app.go index 33da2c5..711afa2 100644 --- a/internal/cli/app.go +++ b/internal/cli/app.go @@ -3,8 +3,9 @@ package cli import ( "os" - "github.com/make-go-great/color-go" "github.com/urfave/cli/v2" + + "github.com/make-go-great/color-go" ) const ( diff --git a/internal/convention/commit_test.go b/internal/convention/commit_test.go index b08d241..3811eab 100644 --- a/internal/convention/commit_test.go +++ b/internal/convention/commit_test.go @@ -4,9 +4,10 @@ import ( "testing" "time" - "github.com/haunt98/changeloguru/internal/git" "github.com/sebdah/goldie/v2" "github.com/stretchr/testify/assert" + + "github.com/haunt98/changeloguru/internal/git" ) func TestNewCommit(t *testing.T) { diff --git a/internal/convention/option.go b/internal/convention/option.go index dab6471..b970495 100644 --- a/internal/convention/option.go +++ b/internal/convention/option.go @@ -7,8 +7,9 @@ import ( "strings" "time" - "github.com/haunt98/changeloguru/internal/git" "github.com/make-go-great/date-go" + + "github.com/haunt98/changeloguru/internal/git" ) const (