Skip to content

Commit

Permalink
v2 version (#33)
Browse files Browse the repository at this point in the history
* v2 version

* Fix naming
  • Loading branch information
hedhyw authored Jun 12, 2022
1 parent 62b1dc0 commit 527824c
Show file tree
Hide file tree
Showing 35 changed files with 54 additions and 51 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*.dylib
bin

# IDE
.vscode

# Test binary, built with `go test -c`
*.test

Expand Down
2 changes: 1 addition & 1 deletion cmd/gherkingen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"os"

"github.com/hedhyw/gherkingen/internal/app"
"github.com/hedhyw/gherkingen/v2/internal/app"
)

// Version will be set on build.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/hedhyw/gherkingen
module github.com/hedhyw/gherkingen/v2

go 1.18

Expand Down
2 changes: 1 addition & 1 deletion internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"time"

"github.com/hedhyw/gherkingen/internal/model"
"github.com/hedhyw/gherkingen/v2/internal/model"

"github.com/google/uuid"
)
Expand Down
4 changes: 2 additions & 2 deletions internal/app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"flag"
"testing"

"github.com/hedhyw/gherkingen/internal/app"
"github.com/hedhyw/gherkingen/pkg/v1/bdd"
"github.com/hedhyw/gherkingen/v2/internal/app"
"github.com/hedhyw/gherkingen/v2/pkg/bdd"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
8 changes: 4 additions & 4 deletions internal/app/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"fmt"
"io"

"github.com/hedhyw/gherkingen/internal/docplugin/goplugin"
"github.com/hedhyw/gherkingen/internal/docplugin/multiplugin"
"github.com/hedhyw/gherkingen/internal/generator"
"github.com/hedhyw/gherkingen/internal/model"
"github.com/hedhyw/gherkingen/v2/internal/docplugin/goplugin"
"github.com/hedhyw/gherkingen/v2/internal/docplugin/multiplugin"
"github.com/hedhyw/gherkingen/v2/internal/generator"
"github.com/hedhyw/gherkingen/v2/internal/model"
)

func runGenerator(
Expand Down
2 changes: 1 addition & 1 deletion internal/app/readers.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"strings"

"github.com/hedhyw/gherkingen/internal/assets"
"github.com/hedhyw/gherkingen/v2/internal/assets"

"github.com/hedhyw/semerr/pkg/v1/semerr"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/app/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"io"

"github.com/hedhyw/gherkingen/internal/assets"
"github.com/hedhyw/gherkingen/v2/internal/assets"
)

func runListTemplates(out io.Writer) (err error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

func runVersion(w io.Writer, version string) error {
fmt.Fprintln(w, "github.com/hedhyw/gherkingen@"+version)
fmt.Fprintln(w, "github.com/hedhyw/gherkingen/v2@"+version)

return nil
}
2 changes: 1 addition & 1 deletion internal/assets/assets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"io/ioutil"
"testing"

"github.com/hedhyw/gherkingen/internal/assets"
"github.com/hedhyw/gherkingen/v2/internal/assets"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion internal/assets/std.struct.v1.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package {{ .PackageName }}
import (
"testing"

"github.com/hedhyw/gherkingen/pkg/v1/bdd"
"github.com/hedhyw/gherkingen/v2/pkg/bdd"
)

{{ define "Background" }}
Expand Down
2 changes: 1 addition & 1 deletion internal/docplugin/goplugin/goaliaser/goaliaser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package goaliaser_test
import (
"testing"

"github.com/hedhyw/gherkingen/internal/docplugin/goplugin/goaliaser"
"github.com/hedhyw/gherkingen/v2/internal/docplugin/goplugin/goaliaser"

"github.com/stretchr/testify/assert"
)
Expand Down
4 changes: 2 additions & 2 deletions internal/docplugin/goplugin/goplugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"reflect"
"strings"

"github.com/hedhyw/gherkingen/internal/docplugin/goplugin/goaliaser"
"github.com/hedhyw/gherkingen/internal/model"
"github.com/hedhyw/gherkingen/v2/internal/docplugin/goplugin/goaliaser"
"github.com/hedhyw/gherkingen/v2/internal/model"
)

const maxRecursionDepth = 10
Expand Down
6 changes: 3 additions & 3 deletions internal/docplugin/goplugin/goplugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"testing"

"github.com/hedhyw/gherkingen/internal/docplugin/goplugin"
"github.com/hedhyw/gherkingen/internal/model"
"github.com/hedhyw/gherkingen/v2/internal/docplugin/goplugin"
"github.com/hedhyw/gherkingen/v2/internal/model"

"github.com/stretchr/testify/assert"
)
Expand Down Expand Up @@ -65,7 +65,7 @@ func TestGoPluginProcess(t *testing.T) {
t.Run("Examples_underscore", func(t *testing.T) {
t.Parallel()

// It tests https://github.com/hedhyw/gherkingen/issues/26.
// It tests https://github.com/hedhyw/gherkingen/v2/issues/26.

doc := getExampleDocument()
if assert.NoError(t, p.Process(ctx, doc)) {
Expand Down
4 changes: 2 additions & 2 deletions internal/docplugin/multiplugin/multiplugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"

"github.com/hedhyw/gherkingen/internal/docplugin"
"github.com/hedhyw/gherkingen/internal/model"
"github.com/hedhyw/gherkingen/v2/internal/docplugin"
"github.com/hedhyw/gherkingen/v2/internal/model"
)

// MultiPlugin helps to process many plugins.
Expand Down
6 changes: 3 additions & 3 deletions internal/docplugin/multiplugin/multiplugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"testing"

"github.com/hedhyw/gherkingen/internal/docplugin/goplugin"
"github.com/hedhyw/gherkingen/internal/docplugin/multiplugin"
"github.com/hedhyw/gherkingen/internal/model"
"github.com/hedhyw/gherkingen/v2/internal/docplugin/goplugin"
"github.com/hedhyw/gherkingen/v2/internal/docplugin/multiplugin"
"github.com/hedhyw/gherkingen/v2/internal/model"

"github.com/hedhyw/semerr/pkg/v1/semerr"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion internal/docplugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package docplugin
import (
"context"

"github.com/hedhyw/gherkingen/internal/model"
"github.com/hedhyw/gherkingen/v2/internal/model"
)

// Plugin injects extra data to document.
Expand Down
2 changes: 1 addition & 1 deletion internal/generator/examples/background.feature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package examples_test
import (
"testing"

"github.com/hedhyw/gherkingen/pkg/v1/bdd"
"github.com/hedhyw/gherkingen/v2/pkg/bdd"
)

func TestMultipleSiteSupport(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/generator/examples/issue_26.feature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package examples_test
import (
"testing"

"github.com/hedhyw/gherkingen/pkg/v1/bdd"
"github.com/hedhyw/gherkingen/v2/pkg/bdd"
)

func TestIssueExample(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/generator/examples/readme.feature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package examples_test
import (
"testing"

"github.com/hedhyw/gherkingen/pkg/v1/bdd"
"github.com/hedhyw/gherkingen/v2/pkg/bdd"
)

func TestApplicationCommandLineTool(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/generator/examples/rules.feature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package examples_test
import (
"testing"

"github.com/hedhyw/gherkingen/pkg/v1/bdd"
"github.com/hedhyw/gherkingen/v2/pkg/bdd"
)

func TestHighlander(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/generator/examples/scenario.feature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package examples_test
import (
"testing"

"github.com/hedhyw/gherkingen/pkg/v1/bdd"
"github.com/hedhyw/gherkingen/v2/pkg/bdd"
)

func TestSomeTerseYetDescriptiveTextOfWhatIsDesired(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/generator/examples/simple.feature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package examples_test
import (
"testing"

"github.com/hedhyw/gherkingen/pkg/v1/bdd"
"github.com/hedhyw/gherkingen/v2/pkg/bdd"
)

func TestGuessTheWord(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions internal/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"context"
"fmt"

"github.com/hedhyw/gherkingen/internal/docplugin"
"github.com/hedhyw/gherkingen/internal/model"
"github.com/hedhyw/gherkingen/v2/internal/docplugin"
"github.com/hedhyw/gherkingen/v2/internal/model"

"github.com/cucumber/gherkin-go/v19"
"github.com/google/uuid"
Expand Down
4 changes: 2 additions & 2 deletions internal/generator/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
_ "embed"
"testing"

"github.com/hedhyw/gherkingen/internal/generator"
"github.com/hedhyw/gherkingen/internal/model"
"github.com/hedhyw/gherkingen/v2/internal/generator"
"github.com/hedhyw/gherkingen/v2/internal/model"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/generator/golang.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"go/format"

"github.com/hedhyw/gherkingen/internal/model"
"github.com/hedhyw/gherkingen/v2/internal/model"
)

// generateGo generates raw output and formates it with go formatter.
Expand Down
10 changes: 5 additions & 5 deletions internal/generator/golang_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"io"
"testing"

"github.com/hedhyw/gherkingen/internal/assets"
"github.com/hedhyw/gherkingen/internal/docplugin/goplugin"
"github.com/hedhyw/gherkingen/internal/docplugin/multiplugin"
"github.com/hedhyw/gherkingen/internal/generator"
"github.com/hedhyw/gherkingen/internal/model"
"github.com/hedhyw/gherkingen/v2/internal/assets"
"github.com/hedhyw/gherkingen/v2/internal/docplugin/goplugin"
"github.com/hedhyw/gherkingen/v2/internal/docplugin/multiplugin"
"github.com/hedhyw/gherkingen/v2/internal/generator"
"github.com/hedhyw/gherkingen/v2/internal/model"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion internal/generator/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"fmt"

"github.com/hedhyw/gherkingen/internal/model"
"github.com/hedhyw/gherkingen/v2/internal/model"
)

// generateJSON generates output in JSON.
Expand Down
4 changes: 2 additions & 2 deletions internal/generator/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"encoding/json"
"testing"

"github.com/hedhyw/gherkingen/internal/generator"
"github.com/hedhyw/gherkingen/internal/model"
"github.com/hedhyw/gherkingen/v2/internal/generator"
"github.com/hedhyw/gherkingen/v2/internal/model"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/generator/raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"text/template"
"unicode"

"github.com/hedhyw/gherkingen/internal/model"
"github.com/hedhyw/gherkingen/v2/internal/model"

"github.com/iancoleman/strcase"
)
Expand Down
4 changes: 2 additions & 2 deletions internal/generator/raw_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package generator_test
import (
"testing"

"github.com/hedhyw/gherkingen/internal/generator"
"github.com/hedhyw/gherkingen/internal/model"
"github.com/hedhyw/gherkingen/v2/internal/generator"
"github.com/hedhyw/gherkingen/v2/internal/model"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/model/document_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strconv"
"testing"

"github.com/hedhyw/gherkingen/internal/model"
"github.com/hedhyw/gherkingen/v2/internal/model"

"github.com/cucumber/messages-go/v16"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion internal/model/enums_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package model_test
import (
"testing"

"github.com/hedhyw/gherkingen/internal/model"
"github.com/hedhyw/gherkingen/v2/internal/model"

"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/v1/bdd/bdd_test.go → pkg/bdd/bdd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package bdd_test
import (
"testing"

"github.com/hedhyw/gherkingen/pkg/v1/bdd"
"github.com/hedhyw/gherkingen/v2/pkg/bdd"
)

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

0 comments on commit 527824c

Please sign in to comment.