Skip to content

Commit 6f3e792

Browse files
authored
Add deprecation notice to godog CLI (#489)
* Add deprecation notice to godog CLI * Update CHANGELOG
1 parent d45a9aa commit 6f3e792

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt
99
## Unreleased
1010

1111
### Changed
12-
- README example is updated with `context.Context` and `go test` usage. ([477](https://github.com/cucumber/godog/pull/477) - [vearutop](https://github.com/vearutop))
12+
- README example is updated with `context.Context` and `go test` usage. ([477](https://github.com/cucumber/godog/pull/477) - [vearutop](https://github.com/vearutop))
1313

1414
### Fixed
1515
- Fixed a bug which would ignore the context returned from a substep.([488](https://github.com/cucumber/godog/pull/488) - [wichert](https://github.com/wichert))
1616
- Fixed a bug which would cause a panic when using the pretty formatter with a feature that contained a rule. ([480](https://github.com/cucumber/godog/pull/480) - [dumpsterfireproject](https://github.com/dumpsterfireproject))
1717

18+
### Deprecated
19+
- `godog` CLI tool prints deprecation warning. ([489](https://github.com/cucumber/godog/pull/489) - [vearutop](https://github.com/vearutop))
20+
1821
## [v0.12.5]
1922
### Changed
2023
- Changed underlying cobra command setup to return errors instead of calling `os.Exit` directly to enable simpler testing. ([454](https://github.com/cucumber/godog/pull/454) - [mxygem](https://github.com/mxygem))

cmd/godog/internal/cmd_build.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import (
55
"go/build"
66
"path/filepath"
77

8+
"github.com/cucumber/godog/colors"
89
"github.com/cucumber/godog/internal/builder"
10+
911
"github.com/spf13/cobra"
1012
)
1113

@@ -37,6 +39,9 @@ The test runner can be executed with the same flags as when using godog run.`,
3739
}
3840

3941
func buildCmdRunFunc(cmd *cobra.Command, args []string) error {
42+
fmt.Println(colors.Yellow("Use of godog CLI is deprecated, please use *testing.T instead."))
43+
fmt.Println(colors.Yellow("See https://github.com/cucumber/godog/discussions/478 for details."))
44+
4045
bin, err := filepath.Abs(buildOutput)
4146
if err != nil {
4247
return fmt.Errorf("could not locate absolute path for: %q. reason: %v", buildOutput, err)

cmd/godog/internal/cmd_root.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ func runRootCmd(cmd *cobra.Command, args []string) error {
4444
}
4545
}
4646

47-
fmt.Println(colors.Yellow("Use of godog without a sub-command is deprecated. Please use godog build, godog run or godog version."))
47+
fmt.Println(colors.Yellow("Use of godog CLI is deprecated, please use *testing.T instead."))
48+
fmt.Println(colors.Yellow("See https://github.com/cucumber/godog/discussions/478 for details."))
4849
return runCmdRunFunc(cmd, args)
4950
}
5051

cmd/godog/internal/cmd_run.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99

1010
"github.com/spf13/cobra"
1111

12+
"github.com/cucumber/godog/colors"
1213
"github.com/cucumber/godog/internal/builder"
1314
"github.com/cucumber/godog/internal/flags"
1415
)
@@ -42,6 +43,9 @@ buildable go source.`,
4243
}
4344

4445
func runCmdRunFunc(cmd *cobra.Command, args []string) error {
46+
fmt.Println(colors.Yellow("Use of godog CLI is deprecated, please use *testing.T instead."))
47+
fmt.Println(colors.Yellow("See https://github.com/cucumber/godog/discussions/478 for details."))
48+
4549
osArgs := os.Args[1:]
4650

4751
if len(osArgs) > 0 && osArgs[0] == "run" {

0 commit comments

Comments
 (0)