diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1a0f663215901c43a469bcc989a28fcac8daf979..158a31f848dc5e3aad2de1c4800d4635fc7ad5d3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -74,6 +74,19 @@ lint_commit: - if: '$CI_MERGE_REQUEST_IID && $CI_PROJECT_VISIBILITY == "public"' # lint.js script makes an API call without authentication when: always +goimports: + script: + - go install golang.org/x/tools/cmd/goimports@latest + - FMT_CMD='goimports -w -local gitlab.com/gitlab-org .' + - eval "$FMT_CMD" + - | + if ! git diff --ignore-submodules=dirty --exit-code; then + echo + echo "Some files are not formatted. Please format with \`$FMT_CMD\`" + echo 'See https://docs.gitlab.com/ee/development/go_guide/#code-style-and-format for more information' + exit 1 + fi + code_navigation: stage: test image: golang:latest diff --git a/api/client.go b/api/client.go index 263f213221401be00d59909ac76cd92105772bbe..c29d53f08eee71e53f4004ef4cfda6f684bff2ec 100644 --- a/api/client.go +++ b/api/client.go @@ -14,6 +14,7 @@ import ( "time" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/internal/config" "gitlab.com/gitlab-org/cli/pkg/glinstance" ) diff --git a/api/pipeline.go b/api/pipeline.go index 86372a67ba95989ec3e4019bcd355f9d64229e24..91a69cdf6dfbccc32cedaa0b4140ee544a0d47e8 100644 --- a/api/pipeline.go +++ b/api/pipeline.go @@ -7,6 +7,7 @@ import ( "sort" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/pkg/git" ) @@ -179,9 +180,9 @@ var GetPipelineVariables = func(client *gitlab.Client, pid int, l *gitlab.Reques } pipe, _, err := client.Pipelines.GetPipeline(repo, pid) - if err != nil { - return nil, err - } + if err != nil { + return nil, err + } projectID := pipe.ProjectID pipelineVars, _, err := client.Pipelines.GetPipelineVariables(projectID, pid) diff --git a/cmd/gen-docs/docs.go b/cmd/gen-docs/docs.go index 589097f7e8f2c0d73dad40d375453bd35b4448e1..2713bb6b6aeb055b4e890b2d18df3b347af855fb 100644 --- a/cmd/gen-docs/docs.go +++ b/cmd/gen-docs/docs.go @@ -14,6 +14,7 @@ import ( "github.com/spf13/pflag" "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/commands" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" diff --git a/cmd/glab/main.go b/cmd/glab/main.go index 00d0fd914bbf1e0758efeb9d37c65e0d3c0469df..f4fbdb7c5f753708473cbe69643fad93e6d941f0 100644 --- a/cmd/glab/main.go +++ b/cmd/glab/main.go @@ -14,6 +14,7 @@ import ( "github.com/mgutz/ansi" surveyCore "github.com/AlecAivazis/survey/v2/core" + "gitlab.com/gitlab-org/cli/commands" "gitlab.com/gitlab-org/cli/commands/alias/expand" "gitlab.com/gitlab-org/cli/commands/cmdutils" diff --git a/cmd/glab/main_test.go b/cmd/glab/main_test.go index 7959a8977eccce5cdf6df00e56dcbd54a981c65d..9a7bd45445c9feadb3c1c654ff869d788f8fe643 100644 --- a/cmd/glab/main_test.go +++ b/cmd/glab/main_test.go @@ -10,6 +10,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/alias/alias_test.go b/commands/alias/alias_test.go index 85a03e6acb3c028c4d8f78de0db53b9860601102..daeb5c5fcebdae052378493081e8d33fac193bd5 100644 --- a/commands/alias/alias_test.go +++ b/commands/alias/alias_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/alias/delete/alias_delete.go b/commands/alias/delete/alias_delete.go index ea58864a00ce56c45090894b83422fd8569a1cd1..28ffea767fc05bde520b12a012ff98b187bae624 100644 --- a/commands/alias/delete/alias_delete.go +++ b/commands/alias/delete/alias_delete.go @@ -8,6 +8,7 @@ import ( "gitlab.com/gitlab-org/cli/commands/cmdutils" "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/internal/config" ) diff --git a/commands/alias/delete/alias_delete_test.go b/commands/alias/delete/alias_delete_test.go index d015fc455a5f67210c33e68de630cadd30f4b283..313c57f2dcb991c902925deafb3e7b903a0becc8 100644 --- a/commands/alias/delete/alias_delete_test.go +++ b/commands/alias/delete/alias_delete_test.go @@ -8,6 +8,7 @@ import ( "gitlab.com/gitlab-org/cli/pkg/iostreams" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" diff --git a/commands/alias/expand/alias_expand.go b/commands/alias/expand/alias_expand.go index 8dab27a82d556fe556a40710f3f1553030ff6662..bc0be777c437d1110d310de055fd1fd4da7359c2 100644 --- a/commands/alias/expand/alias_expand.go +++ b/commands/alias/expand/alias_expand.go @@ -12,6 +12,7 @@ import ( "gitlab.com/gitlab-org/cli/pkg/execext" "github.com/google/shlex" + "gitlab.com/gitlab-org/cli/internal/config" ) diff --git a/commands/alias/set/alias_set.go b/commands/alias/set/alias_set.go index d2647fbb28c3f281088cea1c3426db06062711db..05d4c7be176a274d0cb04f5918892e7d52dea0de 100644 --- a/commands/alias/set/alias_set.go +++ b/commands/alias/set/alias_set.go @@ -11,6 +11,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/google/shlex" "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/internal/config" ) diff --git a/commands/alias/set/alias_set_test.go b/commands/alias/set/alias_set_test.go index 252a87cd68ed98f80beb73fd08a483dbfed77c68..fae01a0e932b3b39d14c4fe3d16b3c87575ca99c 100644 --- a/commands/alias/set/alias_set_test.go +++ b/commands/alias/set/alias_set_test.go @@ -9,6 +9,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/google/shlex" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" diff --git a/commands/api/api.go b/commands/api/api.go index d3ad1f6712397c695c6c9bfa99382be77c50f971..cfd65ece33df1b120863a8d6573a16c5b55361ca 100644 --- a/commands/api/api.go +++ b/commands/api/api.go @@ -23,6 +23,7 @@ import ( "github.com/spf13/cobra" jsonPretty "github.com/tidwall/pretty" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" "gitlab.com/gitlab-org/cli/internal/glrepo" @@ -104,7 +105,7 @@ func NewCmdApi(f *cmdutils.Factory, runF func(*ApiOptions) error) *cobra.Command there are no more pages of results. For GraphQL requests, this requires that the original query accepts an '$endCursor: String' variable and that it fetches the 'pageInfo{ hasNextPage, endCursor }' set of fields from a collection. - `,"`"), + `, "`"), Example: heredoc.Doc(` $ glab api projects/:fullpath/releases diff --git a/commands/api/api_test.go b/commands/api/api_test.go index 6f905bf775f08224404ddb97ad8ae74bbb31d36d..52b771da2a937e457b57dc245cd1770d438a9d43 100644 --- a/commands/api/api_test.go +++ b/commands/api/api_test.go @@ -12,6 +12,7 @@ import ( "gitlab.com/gitlab-org/cli/pkg/iostreams" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdtest" "gitlab.com/gitlab-org/cli/commands/cmdutils" diff --git a/commands/api/http_test.go b/commands/api/http_test.go index 9825e3b12dc6a19e323da32642ab22a16a6c2670..ebfc06535c667a1ac5042b1bf3897375ddd6a210 100644 --- a/commands/api/http_test.go +++ b/commands/api/http_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/internal/config" ) diff --git a/commands/auth/auth.go b/commands/auth/auth.go index b4dd992708b0617a3237e70608022c4cf7ba1797..341b38584f35bb10bee88538653515e1fe898c56 100644 --- a/commands/auth/auth.go +++ b/commands/auth/auth.go @@ -2,6 +2,7 @@ package auth import ( "github.com/spf13/cobra" + authLoginCmd "gitlab.com/gitlab-org/cli/commands/auth/login" authStatusCmd "gitlab.com/gitlab-org/cli/commands/auth/status" "gitlab.com/gitlab-org/cli/commands/cmdutils" diff --git a/commands/auth/auth_test.go b/commands/auth/auth_test.go index 935de927ce883caa4605988d91061b033694b0b0..e5985d71e1f93054a0ddc81e937963ec0f2a725f 100644 --- a/commands/auth/auth_test.go +++ b/commands/auth/auth_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/auth/login/login.go b/commands/auth/login/login.go index 3464c9000f424a1da406d078218ae71f38794d68..d244c8ad1b7a51276efef7d208a6d9f40172c760 100644 --- a/commands/auth/login/login.go +++ b/commands/auth/login/login.go @@ -15,6 +15,7 @@ import ( "github.com/AlecAivazis/survey/v2" "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" diff --git a/commands/auth/login/login_test.go b/commands/auth/login/login_test.go index faab077bc03618e8a82a6dc765c4c101f16856a0..419979227521a9da3d811d8f166cc23a98143483 100644 --- a/commands/auth/login/login_test.go +++ b/commands/auth/login/login_test.go @@ -8,6 +8,7 @@ import ( "github.com/google/shlex" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdtest" ) diff --git a/commands/auth/status/status.go b/commands/auth/status/status.go index 9924cbb4e5802d97892a518968161bffbe2d77c8..bcdd90b8f65d1f3ee20472744e56b1313255372c 100644 --- a/commands/auth/status/status.go +++ b/commands/auth/status/status.go @@ -7,6 +7,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" diff --git a/commands/ci/artifact/artifact.go b/commands/ci/artifact/artifact.go index b08dbc554cc2ae527dd9c194c0bdc3c301a15078..5a76ec2091c6c71ab6125a36de448de12c31bf65 100644 --- a/commands/ci/artifact/artifact.go +++ b/commands/ci/artifact/artifact.go @@ -9,6 +9,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" diff --git a/commands/ci/ci_test.go b/commands/ci/ci_test.go index bcd21e53b912aa58059bf79384a885cf136832da..5353ad6f8338c02c89ee36dc868228e038929c61 100644 --- a/commands/ci/ci_test.go +++ b/commands/ci/ci_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/ci/get/get.go b/commands/ci/get/get.go index 59cd55dcee846a49794d7f4277726227c8fbfc96..eb057eea04a516034852b5225acd642cc4400dcb 100644 --- a/commands/ci/get/get.go +++ b/commands/ci/get/get.go @@ -6,6 +6,7 @@ import ( "strconv" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/pkg/git" diff --git a/commands/ci/legacyci/pipeline_ci_test.go b/commands/ci/legacyci/pipeline_ci_test.go index ea4fc5ba8a19e4a8fcde38b9028f9d835151b874..13f6a87c37cd40c2327d71d119a607ebe3eae138 100644 --- a/commands/ci/legacyci/pipeline_ci_test.go +++ b/commands/ci/legacyci/pipeline_ci_test.go @@ -9,6 +9,7 @@ import ( "gitlab.com/gitlab-org/cli/pkg/iostreams" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/ci/lint/lint_test.go b/commands/ci/lint/lint_test.go index d897570d4165afdca18b617e6d22a5a83e0e1dec..7e7d8a6f0cc609e5fb9eed756ae6fddcc3667368 100644 --- a/commands/ci/lint/lint_test.go +++ b/commands/ci/lint/lint_test.go @@ -6,6 +6,7 @@ import ( "gitlab.com/gitlab-org/cli/pkg/iostreams" "github.com/alecthomas/assert" + "gitlab.com/gitlab-org/cli/commands/cmdtest" ) diff --git a/commands/ci/trace/trace_test.go b/commands/ci/trace/trace_test.go index 491c151da1f328eda19281332dce59fa0c1e28a5..70c328cba94414e09e045dc1be66c88e7024fe16 100644 --- a/commands/ci/trace/trace_test.go +++ b/commands/ci/trace/trace_test.go @@ -9,9 +9,11 @@ import ( "github.com/alecthomas/assert" "github.com/google/shlex" + "gitlab.com/gitlab-org/cli/pkg/prompt" "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" diff --git a/commands/cmdtest/helper.go b/commands/cmdtest/helper.go index 646111612c578022a23565e61fe30053dc86f780..a5d8d5500270ec1c97065b9fffb6fdbc3c3118e1 100644 --- a/commands/cmdtest/helper.go +++ b/commands/cmdtest/helper.go @@ -18,6 +18,7 @@ import ( "github.com/google/shlex" "github.com/otiai10/copy" "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" "gitlab.com/gitlab-org/cli/test" diff --git a/commands/cmdutils/cmdutils.go b/commands/cmdutils/cmdutils.go index 5b9042fa37ee7cbaadd641ec7093ad398832c765..87a040384aa0c1d6b1596c02aa9fff91ef68d110 100644 --- a/commands/cmdutils/cmdutils.go +++ b/commands/cmdutils/cmdutils.go @@ -13,11 +13,13 @@ import ( "gitlab.com/gitlab-org/cli/pkg/iostreams" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/internal/glrepo" "gitlab.com/gitlab-org/cli/pkg/utils" "github.com/AlecAivazis/survey/v2" + "gitlab.com/gitlab-org/cli/pkg/prompt" "gitlab.com/gitlab-org/cli/pkg/surveyext" diff --git a/commands/cmdutils/cmdutils_test.go b/commands/cmdutils/cmdutils_test.go index 6b7810faceb58fa70abe8524910ed26e8c1324e2..627f6234bf727ce3e31e2a6f384f90e3757c3caf 100644 --- a/commands/cmdutils/cmdutils_test.go +++ b/commands/cmdutils/cmdutils_test.go @@ -11,6 +11,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/internal/glrepo" "gitlab.com/gitlab-org/cli/pkg/git" diff --git a/commands/cmdutils/factory.go b/commands/cmdutils/factory.go index 67e78397a66e29bb5bb9362c729338e44d774fdc..bdeb34fa9974bf0ad26fd295644985ddcc78e16b 100644 --- a/commands/cmdutils/factory.go +++ b/commands/cmdutils/factory.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/internal/config" "gitlab.com/gitlab-org/cli/internal/glrepo" diff --git a/commands/cmdutils/remote_resolver_test.go b/commands/cmdutils/remote_resolver_test.go index ec1987e11db16849c81d9cd9785c5601f9225127..24a11ff5c387ba5ab51187e02ccb17a829b09fa7 100644 --- a/commands/cmdutils/remote_resolver_test.go +++ b/commands/cmdutils/remote_resolver_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/cli/internal/config" "gitlab.com/gitlab-org/cli/pkg/git" diff --git a/commands/completion/completion.go b/commands/completion/completion.go index a7eeabb87aa1b8db866695f8ecd35c748ecce242..cf12e49cb51dd0d433e851e7e674482fd016434c 100644 --- a/commands/completion/completion.go +++ b/commands/completion/completion.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/pkg/iostreams" "github.com/spf13/cobra" diff --git a/commands/config/config.go b/commands/config/config.go index 29159fd4ccec53ac0f588285793d757710899929..bbe5f493d6a431ec03f0158a6f53fd82bbf1af1c 100644 --- a/commands/config/config.go +++ b/commands/config/config.go @@ -147,7 +147,7 @@ func NewCmdConfigInit(f *cmdutils.Factory) *cobra.Command { $ glab config init ? Enter default GitLab Host (Current Value: https://gitlab.com): %[1]s -`,"```"), +`, "```"), RunE: func(cmd *cobra.Command, args []string) error { return configInit(f) }, diff --git a/commands/config/config_test.go b/commands/config/config_test.go index 92739c794d78b55d325ad13d9e5925d079ff7c51..062b67c16472d68d543bd5876f9f864f22252101 100644 --- a/commands/config/config_test.go +++ b/commands/config/config_test.go @@ -7,9 +7,11 @@ import ( "gitlab.com/gitlab-org/cli/pkg/iostreams" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/cli/internal/config" ) diff --git a/commands/help/help_test.go b/commands/help/help_test.go index c367e2f61952032d6390ba11e044be418ab84c15..589fa05dd53bfd03cd1d8e9672d022841b7b3d3f 100644 --- a/commands/help/help_test.go +++ b/commands/help/help_test.go @@ -10,6 +10,7 @@ import ( "github.com/spf13/cobra" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/alias" "gitlab.com/gitlab-org/cli/commands/alias/set" "gitlab.com/gitlab-org/cli/commands/cmdutils" diff --git a/commands/issue/board/board.go b/commands/issue/board/board.go index e4eacf44fa79a7550b8fdd068fe719981d96ae89..8e2fe11dc86f88d8cd8d3348d85b60af3b4a2f87 100644 --- a/commands/issue/board/board.go +++ b/commands/issue/board/board.go @@ -2,6 +2,7 @@ package board import ( "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/commands/cmdutils" boardCreateCmd "gitlab.com/gitlab-org/cli/commands/issue/board/create" boardViewCmd "gitlab.com/gitlab-org/cli/commands/issue/board/view" diff --git a/commands/issue/board/board_test.go b/commands/issue/board/board_test.go index cd9ed75afb363181295df0c63fa0b754aec4d54c..20bd39936e2bb572e0dca4815cae739f77cf2d1f 100644 --- a/commands/issue/board/board_test.go +++ b/commands/issue/board/board_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/issue/board/create/issue_board_create.go b/commands/issue/board/create/issue_board_create.go index 93bbfd2a31e6792d794605751b24890086ffd6b2..5410b3d2bd64ce990b295a03a50bac1ce5ec8640 100644 --- a/commands/issue/board/create/issue_board_create.go +++ b/commands/issue/board/create/issue_board_create.go @@ -7,6 +7,7 @@ import ( "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/issue/board/create/issue_board_create_test.go b/commands/issue/board/create/issue_board_create_test.go index f153b031147026728b8ca6a40d40104de81b5819..f7e414f2b787fc188bc48ab366f5474733951c50 100644 --- a/commands/issue/board/create/issue_board_create_test.go +++ b/commands/issue/board/create/issue_board_create_test.go @@ -12,6 +12,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdtest" ) diff --git a/commands/issue/board/view/issue_board_view.go b/commands/issue/board/view/issue_board_view.go index 5c3fd16d25580032a0020690d843569252281e61..6f84d2dba2f6a5367813222559c1a5271cebc818 100644 --- a/commands/issue/board/view/issue_board_view.go +++ b/commands/issue/board/view/issue_board_view.go @@ -11,6 +11,7 @@ import ( "github.com/rivo/tview" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/glrepo" diff --git a/commands/issue/close/issue_close.go b/commands/issue/close/issue_close.go index 9aafa7faa8a381a36ecdabf8a835b925e66d0ed0..f966706b1b260c99f63b172de76d9fe6ac08fbdf 100644 --- a/commands/issue/close/issue_close.go +++ b/commands/issue/close/issue_close.go @@ -4,10 +4,12 @@ import ( "fmt" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/api" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/issue/issueutils" ) diff --git a/commands/issue/close/issue_close_test.go b/commands/issue/close/issue_close_test.go index 2691123c34dec858be91aea54db1cda02e5936a5..41f2ec1bf0731272ff0a14fa6ec0ec34f5f839fb 100644 --- a/commands/issue/close/issue_close_test.go +++ b/commands/issue/close/issue_close_test.go @@ -10,9 +10,11 @@ import ( "github.com/acarl005/stripansi" "github.com/stretchr/testify/require" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdtest" ) diff --git a/commands/issue/create/issue_create.go b/commands/issue/create/issue_create.go index 37d6eb22b52e729511b214afcc672fe29293c119..ad74610b6cfec0144eaabab172705078e4ee28bb 100644 --- a/commands/issue/create/issue_create.go +++ b/commands/issue/create/issue_create.go @@ -10,6 +10,7 @@ import ( "gitlab.com/gitlab-org/cli/pkg/iostreams" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/internal/config" "gitlab.com/gitlab-org/cli/internal/glrepo" "gitlab.com/gitlab-org/cli/pkg/utils" @@ -17,6 +18,7 @@ import ( "github.com/AlecAivazis/survey/v2" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/issue/issueutils" diff --git a/commands/issue/create/issue_create_test.go b/commands/issue/create/issue_create_test.go index 9e919762ec159e3d5f9e623f56c6dca0e3a8f6be..87143297769f53f2828e99a24f7eda40766b9207 100644 --- a/commands/issue/create/issue_create_test.go +++ b/commands/issue/create/issue_create_test.go @@ -15,6 +15,7 @@ import ( "github.com/acarl005/stripansi" "github.com/stretchr/testify/assert" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdtest" ) diff --git a/commands/issue/delete/issue_delete.go b/commands/issue/delete/issue_delete.go index a48a0e44377cce3c40199b1563019910e965d3d5..def465bf41cb851f1170ca706784f99331a2a56f 100644 --- a/commands/issue/delete/issue_delete.go +++ b/commands/issue/delete/issue_delete.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/issue/issueutils" diff --git a/commands/issue/delete/issue_delete_test.go b/commands/issue/delete/issue_delete_test.go index 4d94af7d318e2e64924762fcc9f73a6f24ab11ea..0a960304ac73d78f4c52ed0a702f3471bd85746a 100644 --- a/commands/issue/delete/issue_delete_test.go +++ b/commands/issue/delete/issue_delete_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdtest" ) diff --git a/commands/issue/issue.go b/commands/issue/issue.go index 15354cbb714f59960652345b0aba3eac0861a890..724963e7cf957b3bb3d5d22245850103dca9a8ed 100644 --- a/commands/issue/issue.go +++ b/commands/issue/issue.go @@ -2,6 +2,7 @@ package issue import ( "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/commands/cmdutils" issueBoardCmd "gitlab.com/gitlab-org/cli/commands/issue/board" issueCloseCmd "gitlab.com/gitlab-org/cli/commands/issue/close" diff --git a/commands/issue/issue_test.go b/commands/issue/issue_test.go index c4e1dfc0f6d92017a2678649e28c45459749fb19..4d44fa48412810dad882612e4c2a6db92c7f6719 100644 --- a/commands/issue/issue_test.go +++ b/commands/issue/issue_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/issue/issueutils/utils.go b/commands/issue/issueutils/utils.go index 59c45433ca970924178033c47f8152bb8fe04e74..46b00cd460ee9a0d7324475d601584cc4a5731d0 100644 --- a/commands/issue/issueutils/utils.go +++ b/commands/issue/issueutils/utils.go @@ -10,10 +10,11 @@ import ( "gitlab.com/gitlab-org/cli/pkg/iostreams" + "golang.org/x/sync/errgroup" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/internal/config" "gitlab.com/gitlab-org/cli/internal/glrepo" - "golang.org/x/sync/errgroup" "gitlab.com/gitlab-org/cli/pkg/tableprinter" "gitlab.com/gitlab-org/cli/pkg/utils" diff --git a/commands/issue/list/issue_list.go b/commands/issue/list/issue_list.go index 40e5618983a2da464c61cd9e68c469a07af215bd..8d9aadb93c69354cb06999590adfe8fd0f8e7483 100644 --- a/commands/issue/list/issue_list.go +++ b/commands/issue/list/issue_list.go @@ -7,6 +7,7 @@ import ( "gitlab.com/gitlab-org/cli/pkg/iostreams" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/internal/glrepo" "gitlab.com/gitlab-org/cli/api" diff --git a/commands/issue/list/issue_list_test.go b/commands/issue/list/issue_list_test.go index 8fbef87e412e36620ce18f0da2b34c538afc8b4b..ba376fa8915db7a4cef11b88b1fdfba52326f23e 100644 --- a/commands/issue/list/issue_list_test.go +++ b/commands/issue/list/issue_list_test.go @@ -18,6 +18,7 @@ import ( "github.com/alecthomas/assert" "github.com/google/shlex" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" diff --git a/commands/issue/note/issue_note_create_test.go b/commands/issue/note/issue_note_create_test.go index 3eddfb603ac2255b0f0a25cb90aef841f54da4ff..dce23f9516f0755b946ef2597b5dedb4433d3785 100644 --- a/commands/issue/note/issue_note_create_test.go +++ b/commands/issue/note/issue_note_create_test.go @@ -11,6 +11,7 @@ import ( "github.com/alecthomas/assert" "github.com/google/shlex" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" diff --git a/commands/issue/reopen/issue_reopen.go b/commands/issue/reopen/issue_reopen.go index 5cc3927c4be9f4bf0ab8c85044caa50efaa9cb33..89a850d886ae16a1788e9be502560c3466121534 100644 --- a/commands/issue/reopen/issue_reopen.go +++ b/commands/issue/reopen/issue_reopen.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/issue/issueutils" diff --git a/commands/issue/subscribe/issue_subscribe.go b/commands/issue/subscribe/issue_subscribe.go index 4cb95edffdea4fd61900f4e92bd762f34f928385..6524f57423a9a77ec063d250ef1506d309c50963 100644 --- a/commands/issue/subscribe/issue_subscribe.go +++ b/commands/issue/subscribe/issue_subscribe.go @@ -5,6 +5,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/issue/issueutils" diff --git a/commands/issue/subscribe/issue_subscribe_test.go b/commands/issue/subscribe/issue_subscribe_test.go index edc39151056d7b2b83c07de491e00f8aa40b660b..cce8f2454ccbeab1e969373e97e0d8625c062bf5 100644 --- a/commands/issue/subscribe/issue_subscribe_test.go +++ b/commands/issue/subscribe/issue_subscribe_test.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdtest" ) diff --git a/commands/issue/unsubscribe/issue_unsubscribe.go b/commands/issue/unsubscribe/issue_unsubscribe.go index aa24ecd9041606fb4a287ddeb86d139c9d547665..cd2800796ff2e0997ed891dec348a8790c56f4f2 100644 --- a/commands/issue/unsubscribe/issue_unsubscribe.go +++ b/commands/issue/unsubscribe/issue_unsubscribe.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/issue/issueutils" diff --git a/commands/issue/unsubscribe/issue_unsubscribe_test.go b/commands/issue/unsubscribe/issue_unsubscribe_test.go index 455c13705eacc069684ca34aefedb6de9f811e18..52bd60c3aa6fd6138841b2b32a169e9511e9f6ea 100644 --- a/commands/issue/unsubscribe/issue_unsubscribe_test.go +++ b/commands/issue/unsubscribe/issue_unsubscribe_test.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdtest" ) diff --git a/commands/issue/update/issue_update_test.go b/commands/issue/update/issue_update_test.go index da1c388e659d1993c0667d12f607d03908a078b1..166aa10f47b9b3d4e8db587e76de0bdb9240f4f1 100644 --- a/commands/issue/update/issue_update_test.go +++ b/commands/issue/update/issue_update_test.go @@ -14,6 +14,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdtest" ) diff --git a/commands/issue/view/issue_view_test.go b/commands/issue/view/issue_view_test.go index e8da8c3b14a995eed9c667f4a2de6594aea7c06c..bf25268885eac9375270618c42b9aa6bdeeb11c2 100644 --- a/commands/issue/view/issue_view_test.go +++ b/commands/issue/view/issue_view_test.go @@ -14,6 +14,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdtest" "gitlab.com/gitlab-org/cli/commands/cmdutils" diff --git a/commands/label/create/label_create.go b/commands/label/create/label_create.go index b8cdc6d15c7759e07f7814db5b44bcca901b8a75..95c84091bcb5fbcfa0045b7f77a9e3becf973807 100644 --- a/commands/label/create/label_create.go +++ b/commands/label/create/label_create.go @@ -4,10 +4,12 @@ import ( "fmt" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/api" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/label/label.go b/commands/label/label.go index bc4ff553767d373dbb231f3adca70ddca309f45e..6069666b75c14aec2a581cdf7a76932236813c90 100644 --- a/commands/label/label.go +++ b/commands/label/label.go @@ -2,6 +2,7 @@ package label import ( "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/commands/cmdutils" labelCreateCmd "gitlab.com/gitlab-org/cli/commands/label/create" labelListCmd "gitlab.com/gitlab-org/cli/commands/label/list" diff --git a/commands/label/label_test.go b/commands/label/label_test.go index 7d9787db8e8140dfe0ca652866fd9531a0428b36..1a0c37ed5abcb27f090f2227cf88ae53d584e4da 100644 --- a/commands/label/label_test.go +++ b/commands/label/label_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/label/list/label_list.go b/commands/label/list/label_list.go index a65d060347603d23e93e66144a82aa120e7c5451..b7d5d14ef66032eb7bb814d492fe5ffb0bbaa09a 100644 --- a/commands/label/list/label_list.go +++ b/commands/label/list/label_list.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" diff --git a/commands/mr/approve/mr_approve.go b/commands/mr/approve/mr_approve.go index 56d99630e0b11bfec40ece03c6658bba62131e94..02711dfeb8c0f6bd75cd5b8127a6a44b529caa01 100644 --- a/commands/mr/approve/mr_approve.go +++ b/commands/mr/approve/mr_approve.go @@ -6,6 +6,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/mr/mrutils" diff --git a/commands/mr/approvers/mr_approvers.go b/commands/mr/approvers/mr_approvers.go index b82b5404e95d4cfef339085c668386bde2595832..8645f45499ef91de99b29c98f914cce21ddcb438 100644 --- a/commands/mr/approvers/mr_approvers.go +++ b/commands/mr/approvers/mr_approvers.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/mr/mrutils" diff --git a/commands/mr/checkout/mr_checkout.go b/commands/mr/checkout/mr_checkout.go index 2b30789e1ecd6b457f6e2ffea4a52177f77bacd3..a0a26c5355808d5a48dabbeaad17086d97244a1d 100644 --- a/commands/mr/checkout/mr_checkout.go +++ b/commands/mr/checkout/mr_checkout.go @@ -7,6 +7,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/mr/mrutils" diff --git a/commands/mr/close/mr_close.go b/commands/mr/close/mr_close.go index eef0cf4d85ea89ce52e03927369afe907edf4456..f35484bca0600e2c2fc71c65a9818caf1b4c8442 100644 --- a/commands/mr/close/mr_close.go +++ b/commands/mr/close/mr_close.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/mr/mrutils" diff --git a/commands/mr/create/mr_create.go b/commands/mr/create/mr_create.go index 87d8fe05a974dc6c1fcbbd831b63bb9edc6f3a01..38c6dd57c45c462d824ae9cc06b569364460c93e 100644 --- a/commands/mr/create/mr_create.go +++ b/commands/mr/create/mr_create.go @@ -9,17 +9,20 @@ import ( "strings" "github.com/AlecAivazis/survey/v2" + "gitlab.com/gitlab-org/cli/commands/issue/issueutils" "gitlab.com/gitlab-org/cli/pkg/prompt" "gitlab.com/gitlab-org/cli/pkg/iostreams" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/internal/config" "gitlab.com/gitlab-org/cli/internal/glrepo" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/mr/mrutils" diff --git a/commands/mr/create/mr_create_test.go b/commands/mr/create/mr_create_test.go index 1d037817e456eb6ed3eff7e7723e060c95725469..740bcf577581db44b822539e4a4b6b0a15316ad5 100644 --- a/commands/mr/create/mr_create_test.go +++ b/commands/mr/create/mr_create_test.go @@ -12,12 +12,14 @@ import ( "gitlab.com/gitlab-org/cli/pkg/iostreams" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/commands/cmdtest" "gitlab.com/gitlab-org/cli/pkg/prompt" "github.com/google/shlex" "github.com/stretchr/testify/assert" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" diff --git a/commands/mr/delete/mr_delete.go b/commands/mr/delete/mr_delete.go index 139b755aa4b3e2192a41ebaf3cbd58be00a9f7c4..70d71ad4f976d852b47992281e687493b1b83a9f 100644 --- a/commands/mr/delete/mr_delete.go +++ b/commands/mr/delete/mr_delete.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/mr/mrutils" diff --git a/commands/mr/delete/mr_delete_test.go b/commands/mr/delete/mr_delete_test.go index a47faf5a1f1acc456bca2f5a3c3bb9b8108f2dae..ce8a64815678f440d67fe625353ea18658b97b63 100644 --- a/commands/mr/delete/mr_delete_test.go +++ b/commands/mr/delete/mr_delete_test.go @@ -14,6 +14,7 @@ import ( "github.com/acarl005/stripansi" "github.com/stretchr/testify/assert" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdtest" ) diff --git a/commands/mr/diff/diff_test.go b/commands/mr/diff/diff_test.go index f6873b0570d3e25cea884eb4a169d3a9d91f0904..ee9547ec04ffceedf1f7b6abacde8fd5c6e8161e 100644 --- a/commands/mr/diff/diff_test.go +++ b/commands/mr/diff/diff_test.go @@ -11,12 +11,14 @@ import ( "gitlab.com/gitlab-org/cli/pkg/iostreams" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "github.com/google/shlex" "github.com/jarcoal/httpmock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" "gitlab.com/gitlab-org/cli/internal/glrepo" diff --git a/commands/mr/issues/mr_issues.go b/commands/mr/issues/mr_issues.go index a08085755914a4486d9033054a804fbd8973b5b7..934f1fe86355b8b574936f09d5f59f8d9f613b56 100644 --- a/commands/mr/issues/mr_issues.go +++ b/commands/mr/issues/mr_issues.go @@ -5,6 +5,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/issue/issueutils" diff --git a/commands/mr/list/mr_list.go b/commands/mr/list/mr_list.go index 63c0014c638022e6edca60ad0c743f138250301f..776c86e409ee4d2a25645d8868a9fffaabde1878 100644 --- a/commands/mr/list/mr_list.go +++ b/commands/mr/list/mr_list.go @@ -7,6 +7,7 @@ import ( "gitlab.com/gitlab-org/cli/pkg/iostreams" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/internal/glrepo" "gitlab.com/gitlab-org/cli/api" diff --git a/commands/mr/list/mr_list_test.go b/commands/mr/list/mr_list_test.go index 93ca2987b870332f8b9e45dc2ce5ba46d0dd3efd..cfcf2120dc13e186606383abbeb47a3566efa977 100644 --- a/commands/mr/list/mr_list_test.go +++ b/commands/mr/list/mr_list_test.go @@ -18,6 +18,7 @@ import ( "github.com/alecthomas/assert" "github.com/google/shlex" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" diff --git a/commands/mr/merge/mr_merge.go b/commands/mr/merge/mr_merge.go index d77e768f5c029ef6861f00824f0f36a9ad1e1f5b..4a3b42d977f8f77b1e7acca51c0c0a1107ab88e2 100644 --- a/commands/mr/merge/mr_merge.go +++ b/commands/mr/merge/mr_merge.go @@ -10,12 +10,14 @@ import ( "github.com/AlecAivazis/survey/v2" "github.com/MakeNowJust/heredoc" "github.com/avast/retry-go" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/mr/mrutils" "gitlab.com/gitlab-org/cli/pkg/prompt" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/mr/mr.go b/commands/mr/mr.go index 2b1925d60d006b76a534d0282899a808d54c0382..2d4d7a52be2dba96aa70ccd03fd2da383eaf45ef 100644 --- a/commands/mr/mr.go +++ b/commands/mr/mr.go @@ -2,6 +2,7 @@ package mr import ( "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/commands/cmdutils" mrApproveCmd "gitlab.com/gitlab-org/cli/commands/mr/approve" mrApproversCmd "gitlab.com/gitlab-org/cli/commands/mr/approvers" diff --git a/commands/mr/mr_test.go b/commands/mr/mr_test.go index facba1476275fcea62ffdc738bbba231f5c6476d..fcd46baf738081ccdfa8e25a1af07294dfab4fd4 100644 --- a/commands/mr/mr_test.go +++ b/commands/mr/mr_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdtest" "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/mr/mrutils/mrutils.go b/commands/mr/mrutils/mrutils.go index babe8932fc3d7bb0e49126752265ecf0beabd9de..6395a37b0f0882ed9643a57d7712d6ace0be0617 100644 --- a/commands/mr/mrutils/mrutils.go +++ b/commands/mr/mrutils/mrutils.go @@ -11,12 +11,13 @@ import ( "gitlab.com/gitlab-org/cli/pkg/iostreams" "github.com/xanzy/go-gitlab" + "golang.org/x/sync/errgroup" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/glrepo" "gitlab.com/gitlab-org/cli/pkg/prompt" "gitlab.com/gitlab-org/cli/pkg/tableprinter" - "golang.org/x/sync/errgroup" ) type MRCheckErrOptions struct { diff --git a/commands/mr/mrutils/mrutils_test.go b/commands/mr/mrutils/mrutils_test.go index dc7c5fdad2cabb733774b658ba19e4c5b5966d63..b8fa6051284ae714e7c339039253344b60dee28d 100644 --- a/commands/mr/mrutils/mrutils_test.go +++ b/commands/mr/mrutils/mrutils_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/glrepo" diff --git a/commands/mr/note/mr_note_create_test.go b/commands/mr/note/mr_note_create_test.go index 93d8ba0d546213323005bfed3b1c2b88b6d4f758..b2a121777dc5eeabfcd7b8f5912a88c7690c36cd 100644 --- a/commands/mr/note/mr_note_create_test.go +++ b/commands/mr/note/mr_note_create_test.go @@ -11,6 +11,7 @@ import ( "github.com/alecthomas/assert" "github.com/google/shlex" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdtest" "gitlab.com/gitlab-org/cli/commands/cmdutils" diff --git a/commands/mr/rebase/mr_rebase.go b/commands/mr/rebase/mr_rebase.go index 2414c499bc2852e5bb7fd20e03e9c5aa382a3c81..7ffb1c0b5108d94955c6e0543a3538fd1aa24643 100644 --- a/commands/mr/rebase/mr_rebase.go +++ b/commands/mr/rebase/mr_rebase.go @@ -2,6 +2,7 @@ package rebase import ( "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/mr/mrutils" @@ -12,7 +13,7 @@ func NewCmdRebase(f *cmdutils.Factory) *cobra.Command { var mrRebaseCmd = &cobra.Command{ Use: "rebase [ | ] [flags]", Short: `Automatically rebase the source_branch of the merge request against its target_branch.`, - Long: heredoc.Doc(`If you don't have permissions to push to the merge request's source branch - you'll get a 403 Forbidden response. + Long: heredoc.Doc(`If you don't have permissions to push to the merge request's source branch - you'll get a 403 Forbidden response. `), Example: heredoc.Doc(` glab mr rebase 123 diff --git a/commands/mr/reopen/mr_reopen.go b/commands/mr/reopen/mr_reopen.go index 5e610dc8d2a5c0c85945ec27218093f091285a79..87ff52233586ba54904be63f5a24143e58e672ab 100644 --- a/commands/mr/reopen/mr_reopen.go +++ b/commands/mr/reopen/mr_reopen.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/mr/mrutils" diff --git a/commands/mr/revoke/mr_revoke.go b/commands/mr/revoke/mr_revoke.go index 519af2be0170dbaccf13da6da6e31b9ea3f92219..61771afc34d30db2c0ca94ff1e69069bc1e04c9f 100644 --- a/commands/mr/revoke/mr_revoke.go +++ b/commands/mr/revoke/mr_revoke.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/mr/mrutils" diff --git a/commands/mr/subscribe/mr_subscribe.go b/commands/mr/subscribe/mr_subscribe.go index f6e4837b756b8e5459e4ba9a2a626a1a2b2bd286..199c19280916626ca44cf4d34ca7bf5eca1173f5 100644 --- a/commands/mr/subscribe/mr_subscribe.go +++ b/commands/mr/subscribe/mr_subscribe.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/mr/mrutils" diff --git a/commands/mr/subscribe/mr_subscribe_test.go b/commands/mr/subscribe/mr_subscribe_test.go index 9c91415861c5a99736dff17b43b7f53c4a5e0fd4..125d41adbd4dc32988a8cb0451b5bd1114cfcd95 100644 --- a/commands/mr/subscribe/mr_subscribe_test.go +++ b/commands/mr/subscribe/mr_subscribe_test.go @@ -13,6 +13,7 @@ import ( "github.com/acarl005/stripansi" "github.com/stretchr/testify/assert" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdtest" "gitlab.com/gitlab-org/cli/commands/cmdutils" diff --git a/commands/mr/unsubscribe/mr_unsubscribe.go b/commands/mr/unsubscribe/mr_unsubscribe.go index 3330f9ec2083b51da45e315dcf83cf53e2ef48fa..e03f7ae90a97cc0b5551c2c5266feade88d8d9d7 100644 --- a/commands/mr/unsubscribe/mr_unsubscribe.go +++ b/commands/mr/unsubscribe/mr_unsubscribe.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/mr/mrutils" diff --git a/commands/mr/unsubscribe/mr_unsubscribe_test.go b/commands/mr/unsubscribe/mr_unsubscribe_test.go index b14e76677be0fd7b5aa232b5558060381bcf2697..d999be5d59959935c057e73fac606e6c8fe44861 100644 --- a/commands/mr/unsubscribe/mr_unsubscribe_test.go +++ b/commands/mr/unsubscribe/mr_unsubscribe_test.go @@ -13,6 +13,7 @@ import ( "github.com/acarl005/stripansi" "github.com/stretchr/testify/assert" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdtest" "gitlab.com/gitlab-org/cli/internal/config" diff --git a/commands/mr/update/mr_update_test.go b/commands/mr/update/mr_update_test.go index 7396329846e0f3e021f86f642d2da48901ad5056..6742ea8cc7e70c11be6de77a0f8a32be88a90062 100644 --- a/commands/mr/update/mr_update_test.go +++ b/commands/mr/update/mr_update_test.go @@ -15,6 +15,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdtest" "gitlab.com/gitlab-org/cli/commands/cmdutils" diff --git a/commands/mr/view/mr_view_test.go b/commands/mr/view/mr_view_test.go index 8fe5d78e5fcecaa086e2b20d6a6850467da1ec7a..941e6a245512a2843fe5fda491b73ffbe549e2ed 100644 --- a/commands/mr/view/mr_view_test.go +++ b/commands/mr/view/mr_view_test.go @@ -13,11 +13,13 @@ import ( "github.com/acarl005/stripansi" "github.com/stretchr/testify/require" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdtest" "gitlab.com/gitlab-org/cli/internal/run" mainTest "gitlab.com/gitlab-org/cli/test" diff --git a/commands/project/archive/repo_archive.go b/commands/project/archive/repo_archive.go index 7d665d8dc61019eac61b8c0c3a23142333096afa..dbdc9126eacd439581b3e6795066fb1ddbba745a 100644 --- a/commands/project/archive/repo_archive.go +++ b/commands/project/archive/repo_archive.go @@ -12,6 +12,7 @@ import ( "github.com/dustin/go-humanize" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/project/archive/repo_archive_test.go b/commands/project/archive/repo_archive_test.go index a57c7079be33e93011513ddd7fb26bb7b3d764a2..5ac63e676919acc1f5d2e770b97579ef4870914a 100644 --- a/commands/project/archive/repo_archive_test.go +++ b/commands/project/archive/repo_archive_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdtest" ) diff --git a/commands/project/clone/repo_clone.go b/commands/project/clone/repo_clone.go index 21fa0f1619252b6d1580d42c914957d6fb3cd6c2..520724427952ce9d6c6af9cbcc0b8a7fdcd43feb 100644 --- a/commands/project/clone/repo_clone.go +++ b/commands/project/clone/repo_clone.go @@ -12,6 +12,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" diff --git a/commands/project/clone/repo_clone_test.go b/commands/project/clone/repo_clone_test.go index cbff00c37adac003082e1771dc9b87099d2cacf5..1f4efa3b725a6c02439d32e2d5ae63967a9b6588 100644 --- a/commands/project/clone/repo_clone_test.go +++ b/commands/project/clone/repo_clone_test.go @@ -13,11 +13,13 @@ import ( "github.com/google/shlex" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" "gitlab.com/gitlab-org/cli/test" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdtest" ) diff --git a/commands/project/contributors/repo_contributors.go b/commands/project/contributors/repo_contributors.go index 5dd7caa84c908d89b7c4f5561f7048e91004a752..d4d7953c51823f8d2cbc6f19d3b39ccceafdddef 100644 --- a/commands/project/contributors/repo_contributors.go +++ b/commands/project/contributors/repo_contributors.go @@ -8,6 +8,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/glrepo" "gitlab.com/gitlab-org/cli/pkg/tableprinter" diff --git a/commands/project/create/project_create.go b/commands/project/create/project_create.go index 3bbafd2f90ed863202eb04638bad9b4c0fa7de8c..9e85dc1f4cca936a795a197d24ff6e80ddd16e81 100644 --- a/commands/project/create/project_create.go +++ b/commands/project/create/project_create.go @@ -15,6 +15,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/run" "gitlab.com/gitlab-org/cli/pkg/git" diff --git a/commands/project/delete/delete.go b/commands/project/delete/delete.go index afdf54adca4a8a174795deb52ef88f172557ad3a..09030534b73561aa8e91c0dd4d4ca70f56230c0e 100644 --- a/commands/project/delete/delete.go +++ b/commands/project/delete/delete.go @@ -9,6 +9,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/glrepo" diff --git a/commands/project/fork/fork.go b/commands/project/fork/fork.go index a156995ccb96a23eee1413513cbeb7a1ff99b4c0..456377fdd008128abcf9af68bde4f31515a8fb5a 100644 --- a/commands/project/fork/fork.go +++ b/commands/project/fork/fork.go @@ -10,6 +10,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/config" diff --git a/commands/project/list/list.go b/commands/project/list/list.go index c10528fcd1b6826f24b89cb7239965cd1d176197..f0e17ed1176ef9f9d7062ae3c9cb5ee82d3971ab 100644 --- a/commands/project/list/list.go +++ b/commands/project/list/list.go @@ -8,6 +8,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/glrepo" "gitlab.com/gitlab-org/cli/pkg/tableprinter" diff --git a/commands/project/mirror/project_mirror.go b/commands/project/mirror/project_mirror.go index 9759cd7081a125e5476175750a2bf91c0241021f..5733084731ec97468c7e99895eb9b02c5ffecfa1 100644 --- a/commands/project/mirror/project_mirror.go +++ b/commands/project/mirror/project_mirror.go @@ -7,6 +7,7 @@ import ( "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/glrepo" diff --git a/commands/project/repo_test.go b/commands/project/repo_test.go index 99ec620578a98b5618dd98b7d66e2bc712e978b8..cf1f5d4e62154f76fe5cc38c7ffc280b5bdd2b58 100644 --- a/commands/project/repo_test.go +++ b/commands/project/repo_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/project/search/project_search.go b/commands/project/search/project_search.go index a3d14ab46e6c6a436ef8acdbe3cfee1327579621..788dda0493420df131db0d91cb5bdecd0a534be5 100644 --- a/commands/project/search/project_search.go +++ b/commands/project/search/project_search.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/pkg/tableprinter" "gitlab.com/gitlab-org/cli/commands/cmdutils" diff --git a/commands/project/transfer/project_transfer.go b/commands/project/transfer/project_transfer.go index b0a776b8da268c57c7e3a0b828921705056119e7..6b99fe495a18ac16c3244fa20dd75bd4d62119ac 100644 --- a/commands/project/transfer/project_transfer.go +++ b/commands/project/transfer/project_transfer.go @@ -6,6 +6,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/project/view/project_view.go b/commands/project/view/project_view.go index 016c512c17c2f283ab743e3c422a8c79a6efb42d..3d4e324519034bbfb889bd55ec5ae7a19919cb3a 100644 --- a/commands/project/view/project_view.go +++ b/commands/project/view/project_view.go @@ -8,6 +8,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/glrepo" @@ -35,9 +36,9 @@ func NewCmdView(f *cmdutils.Factory) *cobra.Command { var projectViewCmd = &cobra.Command{ Use: "view [repository] [flags]", Short: "View a project/repository", - Long: heredoc.Doc(`Display the description and README of a project or open it in the browser. + Long: heredoc.Doc(`Display the description and README of a project or open it in the browser. `), - Args: cobra.MaximumNArgs(1), + Args: cobra.MaximumNArgs(1), Example: heredoc.Doc(` # view project information for the current directory $ glab repo view diff --git a/commands/release/create/create.go b/commands/release/create/create.go index d6c6ac92381d3ef692adc0a5ebc569802fd942f1..d70ba68b59da6659dc011a964444a0e45208de2c 100644 --- a/commands/release/create/create.go +++ b/commands/release/create/create.go @@ -13,6 +13,7 @@ import ( "github.com/AlecAivazis/survey/v2" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/internal/config" "gitlab.com/gitlab-org/cli/internal/run" "gitlab.com/gitlab-org/cli/pkg/git" @@ -26,6 +27,7 @@ import ( "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/release/delete/delete.go b/commands/release/delete/delete.go index 692fb23f161465fde0f16821f458b22eb3790d15..e5f5c8076e359a6a353ac8670b9bd6fc8230ddb1 100644 --- a/commands/release/delete/delete.go +++ b/commands/release/delete/delete.go @@ -6,6 +6,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/release/releaseutils/upload" "gitlab.com/gitlab-org/cli/internal/config" diff --git a/commands/release/download/download.go b/commands/release/download/download.go index 14eb02478d1cc62daba41d9fc44e0ed5ecae3da5..56da1f9ba3904aadcf0b395bbefd87464da711de 100644 --- a/commands/release/download/download.go +++ b/commands/release/download/download.go @@ -12,6 +12,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/release/releaseutils/upload" diff --git a/commands/release/release.go b/commands/release/release.go index 35230804fcfd73c8f7878da6220e8d27cff59053..58692d818beede980709210ec7498b81897f62f6 100644 --- a/commands/release/release.go +++ b/commands/release/release.go @@ -2,6 +2,7 @@ package release import ( "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/commands/cmdutils" releaseCreateCmd "gitlab.com/gitlab-org/cli/commands/release/create" releaseDeleteCmd "gitlab.com/gitlab-org/cli/commands/release/delete" diff --git a/commands/release/release_test.go b/commands/release/release_test.go index 4c80cb98c9ea84a46a0014d1cf07fa0d7f0a8ba7..ae9865dc5d79765143421c7a88974aab3a489cb8 100644 --- a/commands/release/release_test.go +++ b/commands/release/release_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/release/releaseutils/upload/upload.go b/commands/release/releaseutils/upload/upload.go index 2abff69a6d2ace1bb8657c88f4eccd232f2dedd0..923df98f054117c88351e4d17647d3d19bcaf39d 100644 --- a/commands/release/releaseutils/upload/upload.go +++ b/commands/release/releaseutils/upload/upload.go @@ -5,6 +5,7 @@ import ( "io" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/pkg/glinstance" "gitlab.com/gitlab-org/cli/pkg/iostreams" ) diff --git a/commands/release/upload/upload.go b/commands/release/upload/upload.go index 0af663d49f74c1d91d9f0526e9b09e267004b8c6..e933e8341c398d56eaa4fa8503fe06a2d0e01732 100644 --- a/commands/release/upload/upload.go +++ b/commands/release/upload/upload.go @@ -9,6 +9,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/release/releaseutils" "gitlab.com/gitlab-org/cli/commands/release/releaseutils/upload" diff --git a/commands/release/view/view.go b/commands/release/view/view.go index 9179a05858448e455060e0d9eda7fd2205c36252..6d79d1a9de25be449108a0a43a4abdb87d248d31 100644 --- a/commands/release/view/view.go +++ b/commands/release/view/view.go @@ -7,6 +7,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/release/releaseutils" "gitlab.com/gitlab-org/cli/internal/config" @@ -38,7 +39,7 @@ func NewCmdView(f *cmdutils.Factory, runE func(opts *ViewOpts) error) *cobra.Com Long: heredoc.Doc(`View information about a GitLab Release. Without an explicit tag name argument, the latest release in the project is shown. - `,), + `), Example: heredoc.Doc(` View the latest release of a GitLab repository $ glab release view diff --git a/commands/root.go b/commands/root.go index bcc49f6f923b86d35cd2c2139d5b1cae8897d761..4489e70568f6ce48315391af71a323c669fae160 100644 --- a/commands/root.go +++ b/commands/root.go @@ -6,6 +6,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/spf13/pflag" + aliasCmd "gitlab.com/gitlab-org/cli/commands/alias" apiCmd "gitlab.com/gitlab-org/cli/commands/api" authCmd "gitlab.com/gitlab-org/cli/commands/auth" diff --git a/commands/root_test.go b/commands/root_test.go index 2567d5626432193a6ae740450bfa89586d0eb1ea..5e719d571105ad2fdb6619d932f59f0393e876c8 100644 --- a/commands/root_test.go +++ b/commands/root_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdtest" "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/snippet/create/create.go b/commands/snippet/create/create.go index 69ac995fdb5427e3d9e6fd2d395e6bf6230f6f8d..0ee03d3d6c256368eb36ce4c08b14315c1880cd0 100644 --- a/commands/snippet/create/create.go +++ b/commands/snippet/create/create.go @@ -9,6 +9,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/glrepo" diff --git a/commands/snippet/snippet.go b/commands/snippet/snippet.go index 9b7ad8e9b0ff459bfa1cd5b0d5abdf289cafde4f..d157f8cb4e45667df76b675fe2f94d1157590059 100644 --- a/commands/snippet/snippet.go +++ b/commands/snippet/snippet.go @@ -3,6 +3,7 @@ package snippet import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/snippet/create" ) diff --git a/commands/snippet/snippet_test.go b/commands/snippet/snippet_test.go index e56435054103f840d90e64698154de9992d37d65..d020a23c748b3537549a1fb2d092ccc99fb861d4 100644 --- a/commands/snippet/snippet_test.go +++ b/commands/snippet/snippet_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/alecthomas/assert" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/ssh-key/add/add.go b/commands/ssh-key/add/add.go index 97cef96fed6578250b2db48113edde664d0ab0f7..b0b243202d2b339f41d3f9773860b5ba55d9f428 100644 --- a/commands/ssh-key/add/add.go +++ b/commands/ssh-key/add/add.go @@ -9,6 +9,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/glrepo" "gitlab.com/gitlab-org/cli/pkg/iostreams" diff --git a/commands/ssh-key/get/get.go b/commands/ssh-key/get/get.go index aa60cff101182c1afca8e878d7442a2b131b3343..9c3981b1c696b624a7986d4ab3e80be283f47e2f 100644 --- a/commands/ssh-key/get/get.go +++ b/commands/ssh-key/get/get.go @@ -7,6 +7,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/glrepo" "gitlab.com/gitlab-org/cli/pkg/iostreams" @@ -29,7 +30,7 @@ func NewCmdGet(f *cmdutils.Factory, runE func(*GetOpts) error) *cobra.Command { cmd := &cobra.Command{ Use: "get ", Short: "Returns a single SSH key specified by the ID.", - Long: ``, + Long: ``, Example: heredoc.Doc(` # Get ssh key with ID as argument $ glab ssh-key get 7750633 diff --git a/commands/ssh-key/list/list.go b/commands/ssh-key/list/list.go index b8ed37d3d71f332b58c62420700642b752593946..161e1e1585232afca1b4a7d6074664360a9f58fc 100644 --- a/commands/ssh-key/list/list.go +++ b/commands/ssh-key/list/list.go @@ -4,6 +4,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/glrepo" "gitlab.com/gitlab-org/cli/pkg/iostreams" diff --git a/commands/ssh-key/ssh-key.go b/commands/ssh-key/ssh-key.go index 6a279af3ec4dd2433a79c540796a94ffc06d3c4c..39c6495c7e5e8c150f5b900816650ae24d265f67 100644 --- a/commands/ssh-key/ssh-key.go +++ b/commands/ssh-key/ssh-key.go @@ -2,6 +2,7 @@ package ssh import ( "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/commands/cmdutils" cmdAdd "gitlab.com/gitlab-org/cli/commands/ssh-key/add" cmdGet "gitlab.com/gitlab-org/cli/commands/ssh-key/get" diff --git a/commands/user/events/events.go b/commands/user/events/events.go index afec41299b7b49678d723418c9748321ea185e6b..8c045530a5301da02355ccc1a015d9ed47725b2b 100644 --- a/commands/user/events/events.go +++ b/commands/user/events/events.go @@ -6,6 +6,7 @@ import ( "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/pkg/utils" diff --git a/commands/user/user.go b/commands/user/user.go index 51f182bd5c3d017b6fd405312858a4065f38f0d7..6fdee6f4cef2b3dd48b39b9993b7c089419984cc 100644 --- a/commands/user/user.go +++ b/commands/user/user.go @@ -2,6 +2,7 @@ package user import ( "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/commands/cmdutils" userEventsCmd "gitlab.com/gitlab-org/cli/commands/user/events" ) diff --git a/commands/user/user_test.go b/commands/user/user_test.go index 94dedb1a9b8f50ef10a48473bf51c5afe5888f86..b2af350974323afc4b403607684a9110b2cba6e6 100644 --- a/commands/user/user_test.go +++ b/commands/user/user_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/variable/delete/delete.go b/commands/variable/delete/delete.go index 1d6bb35cbda01c7c15cd75b3429fa29f0b15454e..cc406535c9a78f6a6c2262431428fdcff7c16ce5 100644 --- a/commands/variable/delete/delete.go +++ b/commands/variable/delete/delete.go @@ -6,6 +6,7 @@ import ( "errors" "github.com/MakeNowJust/heredoc" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/variable/variableutils" diff --git a/commands/variable/delete/delete_test.go b/commands/variable/delete/delete_test.go index abb06024304f2f1f3fb1d539d7058d970b27daf5..96bf647a52a17875bb2677c1d0c1ee7db4c0444b 100644 --- a/commands/variable/delete/delete_test.go +++ b/commands/variable/delete/delete_test.go @@ -6,12 +6,14 @@ import ( "testing" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/internal/glrepo" "gitlab.com/gitlab-org/cli/pkg/iostreams" "github.com/alecthomas/assert" "github.com/google/shlex" + "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/pkg/httpmock" ) diff --git a/commands/variable/get/get.go b/commands/variable/get/get.go index 2a88680b191a09094be442809ce1227df6ca028a..9c17da64722b235b78aee743dccc00d1029fe405 100644 --- a/commands/variable/get/get.go +++ b/commands/variable/get/get.go @@ -6,6 +6,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/variable/variableutils" diff --git a/commands/variable/get/get_test.go b/commands/variable/get/get_test.go index 22da1922055767afa2e45ca9bdbf62dbe86a7629..533b6f5c86667ff284f0e6e3370f946435a693ad 100644 --- a/commands/variable/get/get_test.go +++ b/commands/variable/get/get_test.go @@ -8,6 +8,7 @@ import ( "github.com/alecthomas/assert" "github.com/google/shlex" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/glrepo" diff --git a/commands/variable/list/list.go b/commands/variable/list/list.go index 11621e31e2491462f0d2f7871a8b6fb1f663b4ce..62fbab891b4e122b420a6c54ec1e097fc47a73d7 100644 --- a/commands/variable/list/list.go +++ b/commands/variable/list/list.go @@ -4,6 +4,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/glrepo" diff --git a/commands/variable/set/set.go b/commands/variable/set/set.go index 05b21863611cf6d944712567d8755622c18e15e3..55f326e16b373b413e607692c77220b18fd88550 100644 --- a/commands/variable/set/set.go +++ b/commands/variable/set/set.go @@ -9,6 +9,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/variable/variableutils" diff --git a/commands/variable/set/set_test.go b/commands/variable/set/set_test.go index b717165d6920a53e473142e2ef6834893083daf0..360a5aae31e56d821ac7dfed040bedc949d97f9f 100644 --- a/commands/variable/set/set_test.go +++ b/commands/variable/set/set_test.go @@ -10,6 +10,7 @@ import ( "github.com/alecthomas/assert" "github.com/google/shlex" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/glrepo" diff --git a/commands/variable/update/update.go b/commands/variable/update/update.go index 9e567aa4834dca920ba821ea954f8a58dc40f0d5..4d67fa8a67d394333fd73d9498358ee91f9f5928 100644 --- a/commands/variable/update/update.go +++ b/commands/variable/update/update.go @@ -9,6 +9,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/commands/variable/variableutils" diff --git a/commands/variable/update/update_test.go b/commands/variable/update/update_test.go index 4f9da44c8e3cc94739c15ee5983523c741b23e3b..adb17339e7c39b2adc59575a2404d6435e482860 100644 --- a/commands/variable/update/update_test.go +++ b/commands/variable/update/update_test.go @@ -10,6 +10,7 @@ import ( "github.com/alecthomas/assert" "github.com/google/shlex" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/api" "gitlab.com/gitlab-org/cli/commands/cmdutils" "gitlab.com/gitlab-org/cli/internal/glrepo" diff --git a/commands/variable/variable.go b/commands/variable/variable.go index aa9bceecf87d1a1ea6635b5964f73f2bc9213b24..4189a1feaedbfde8cef066551606ead3d9d5aa6c 100644 --- a/commands/variable/variable.go +++ b/commands/variable/variable.go @@ -2,6 +2,7 @@ package variable import ( "github.com/spf13/cobra" + "gitlab.com/gitlab-org/cli/commands/cmdutils" deleteCmd "gitlab.com/gitlab-org/cli/commands/variable/delete" getCmd "gitlab.com/gitlab-org/cli/commands/variable/get" diff --git a/commands/variable/variable_test.go b/commands/variable/variable_test.go index 2d18548d7899348706c6527b3953035ea97dcf3c..214aea714f3d6c556777d3517e84eaad5c24fc1b 100644 --- a/commands/variable/variable_test.go +++ b/commands/variable/variable_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/commands/cmdutils" ) diff --git a/commands/variable/variableutils/value_test.go b/commands/variable/variableutils/value_test.go index 9bd00dc6cdc636de156a7137978fe7656e5dc6d5..108113a2a8e1d6832d3f9539fee20cc603d74c3a 100644 --- a/commands/variable/variableutils/value_test.go +++ b/commands/variable/variableutils/value_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/alecthomas/assert" + "gitlab.com/gitlab-org/cli/pkg/iostreams" ) diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 8471bd0dde3f6b1073b16a2ed3c1c42ed7affae0..c4e3113c9885d3c5ce822cbbe713ed0bda4937c0 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/pkg/prompt" ) diff --git a/internal/glrepo/remote_test.go b/internal/glrepo/remote_test.go index 9b5967d0a9f670d64c336635a83c4f94acafad6a..993d7c06f01a915365ab93b9c097d916b323a41a 100644 --- a/internal/glrepo/remote_test.go +++ b/internal/glrepo/remote_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/cli/pkg/git" ) diff --git a/internal/glrepo/repo.go b/internal/glrepo/repo.go index ef9899705ee82da985e5eba2613e68ce870fd909..412081bc198151b1fddd3c08dd87675cd5700f2e 100644 --- a/internal/glrepo/repo.go +++ b/internal/glrepo/repo.go @@ -11,6 +11,7 @@ import ( "gitlab.com/gitlab-org/cli/internal/config" "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/cli/pkg/git" "gitlab.com/gitlab-org/cli/pkg/glinstance" "gitlab.com/gitlab-org/cli/pkg/utils" diff --git a/pkg/iostreams/terminal.go b/pkg/iostreams/terminal.go index 3114a8927750cddbf7c4456e717b3665083ca50f..5bca99efcac8e6f9591ee1bafaee4d5b16d70099 100644 --- a/pkg/iostreams/terminal.go +++ b/pkg/iostreams/terminal.go @@ -9,8 +9,9 @@ import ( "strings" "github.com/mattn/go-isatty" - "gitlab.com/gitlab-org/cli/pkg/execext" "golang.org/x/term" + + "gitlab.com/gitlab-org/cli/pkg/execext" ) var ( diff --git a/pkg/surveyext/surveyext.go b/pkg/surveyext/surveyext.go index 54f4e6d2ba3aa2aa50192fad673e82501260c8cd..feb5f3b7bf829d54e8853d133be421c24961709a 100644 --- a/pkg/surveyext/surveyext.go +++ b/pkg/surveyext/surveyext.go @@ -15,6 +15,7 @@ import ( "github.com/AlecAivazis/survey/v2" "github.com/AlecAivazis/survey/v2/terminal" "github.com/kballard/go-shellquote" + "gitlab.com/gitlab-org/cli/pkg/execext" ) diff --git a/pkg/tableprinter/table_printer.go b/pkg/tableprinter/table_printer.go index 8ddb8a430c6974d75e08a9ab2fec81f9b238665e..bb4b87b77a970b8d26a8c773c7d6a0b302d49c19 100644 --- a/pkg/tableprinter/table_printer.go +++ b/pkg/tableprinter/table_printer.go @@ -5,6 +5,7 @@ import ( "strings" "github.com/spf13/cast" + "gitlab.com/gitlab-org/cli/pkg/text" ) diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 3c0e568f470aab9d666a05abab791d4e0b40b174..52ef04e2eff915d590672c8be17e35c43293fd41 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -7,6 +7,7 @@ import ( "time" "github.com/charmbracelet/glamour" + "gitlab.com/gitlab-org/cli/internal/run" "gitlab.com/gitlab-org/cli/pkg/browser" )