Repository: datreeio/datree
Pull request #701 (2022-06-28 13:02:38)

build: bump cobra version to "1.5.0"
### Description
Bumps `cobra` version from `v1.1.3` to `v1.5.0`

### Changes
None required as far as I can tell. Build process is successful and `go run main.go` works.

### Issue
Closes  #697



myishay: Hi @aroramrinaal , thanks for your contribution!

Regarding the PR title and commits, we are trying to follow [conventional commits specification](https://www.conventionalcommits.org/en/v1.0.0/#specification) for the commits and `perf:` prefix doesn't apply to it. I suggest using `build:` instead.

In addition, I see the tests don't pass in the travis build.
CuriousCorrelation: @myishay I think you wanted to ping me :wave:

I think I missed those zsh completion changes because I ran tests on some other folder. This new patch should take care of that!

For reference: https://github.com/spf13/cobra/pull/1690

According to the PR

```
#compdef _<command> <command>
```
> enabled completions for both <command> and _<command>, but _<command> is the completion function itself and should not be completed

I have fixed the commit messages. Also divided changes:

1. `go.sum` and `go.mod` in `build:`, and 
2. `cmd/completion` in `fix:`

Let me know if something needs a second look
myishay: I also updated the PR title to match the commit message
myishay: > @myishay I think you wanted to ping me 👋

You are correct! I realized it only now 😅
so @CuriousCorrelation thank _you_ for your contribution 😁 

CuriousCorrelation: > You are correct! I realized it only now 

No worries at all!

PR title is updated. Everything should be good to go
myishay: LGTM!
I have updated the branch to the latest changes and will merge this soon

Patch:
diff --git a/go.mod b/go.mod
index 561e619..5c9ab1b 100644
--- a/go.mod
+++ b/go.mod
@@ -13,7 +13,7 @@ require (
 	github.com/olekukonko/tablewriter v0.0.5
 	github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
 	github.com/santhosh-tekuri/jsonschema/v5 v5.0.0
-	github.com/spf13/cobra v1.1.3
+	github.com/spf13/cobra v1.5.0
 	github.com/spf13/viper v1.7.1
 	github.com/stretchr/testify v1.7.0
 	github.com/xeipuuv/gojsonschema v1.2.0
diff --git a/go.sum b/go.sum
index 17da35b..a3f8199 100644
--- a/go.sum
+++ b/go.sum
@@ -346,8 +346,8 @@ github.com/spf13/afero v1.8.1 h1:izYHOT71f9iZ7iq37Uqjael60/vYC6vMtzedudZ0zEk=
 github.com/spf13/afero v1.8.1/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo=
 github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
 github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
-github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M=
-github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
+github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU=
+github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM=
 github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=
 github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
 github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=


Test patch:
diff --git a/cmd/completion/main_test.go b/cmd/completion/main_test.go
index 3dabd05..cde139f 100644
--- a/cmd/completion/main_test.go
+++ b/cmd/completion/main_test.go
@@ -30,7 +30,7 @@ func Test_ExecuteCommand(t *testing.T) {
 		cmd.Execute()
 
 		got := out.(*bytes.Buffer).Bytes()
-		expected := []byte(`#compdef _completion completion`)
+		expected := []byte(`#compdef completion`)
 
 		assert.Equal(t, string(expected), string(got)[:len(expected)])
 	})