Skip to content

Commit

Permalink
Merge pull request #398 from martinxsliu/generated-import-ordering
Browse files Browse the repository at this point in the history
Imports in generated code should follow conventions
  • Loading branch information
williammartin committed Dec 6, 2017
2 parents 7a241e9 + 0bec0b0 commit e8536d8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions ginkgo/bootstrap_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ func BuildBootstrapCommand() *Command {
var bootstrapText = `package {{.Package}}
import (
"testing"
{{.GinkgoImport}}
{{.GomegaImport}}
"testing"
)
func Test{{.FormattedName}}(t *testing.T) {
Expand All @@ -58,11 +58,11 @@ func Test{{.FormattedName}}(t *testing.T) {
var agoutiBootstrapText = `package {{.Package}}
import (
"testing"
{{.GinkgoImport}}
{{.GomegaImport}}
"github.com/sclevine/agouti"
"testing"
)
func Test{{.FormattedName}}(t *testing.T) {
Expand Down
12 changes: 6 additions & 6 deletions ginkgo/generate_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,26 @@ func BuildGenerateCommand() *Command {
var specText = `package {{.Package}}
import (
{{if .DotImportPackage}}. "{{.PackageImportPath}}"{{end}}
{{if .IncludeImports}}. "github.com/onsi/ginkgo"{{end}}
{{if .IncludeImports}}. "github.com/onsi/gomega"{{end}}
{{if .DotImportPackage}}. "{{.PackageImportPath}}"{{end}}
)
var _ = Describe("{{.Subject}}", func() {
})
`

var agoutiSpecText = `package {{.Package}}_test
var agoutiSpecText = `package {{.Package}}
import (
{{if .DotImportPackage}}. "{{.PackageImportPath}}"{{end}}
{{if .IncludeImports}}. "github.com/onsi/ginkgo"{{end}}
{{if .IncludeImports}}. "github.com/onsi/gomega"{{end}}
. "github.com/sclevine/agouti/matchers"
"github.com/sclevine/agouti"
. "github.com/sclevine/agouti/matchers"
{{if .DotImportPackage}}. "{{.PackageImportPath}}"{{end}}
)
var _ = Describe("{{.Subject}}", func() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package nested_test

import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"testing"
)

func TestNested(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions integration/_fixtures/convert_goldmasters/suite_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package tmp_test

import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"testing"
)

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

0 comments on commit e8536d8

Please sign in to comment.