From 9a555372827b71279dd52c1908bb126b5c7bc60f Mon Sep 17 00:00:00 2001 From: Brian Williams Date: Tue, 15 Nov 2022 15:08:04 -0600 Subject: [PATCH 1/2] ci: Add `go fmt` check to the CI pipeline Ensure that all files are formatted with `go fmt`. --- .gitlab-ci.yml | 6 ++++++ api/pipeline.go | 6 +++--- commands/api/api.go | 2 +- commands/config/config.go | 2 +- commands/mr/rebase/mr_rebase.go | 2 +- commands/project/view/project_view.go | 4 ++-- commands/release/view/view.go | 2 +- commands/ssh-key/get/get.go | 2 +- 8 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1a0f66321..d2363beca 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -74,6 +74,12 @@ lint_commit: - if: '$CI_MERGE_REQUEST_IID && $CI_PROJECT_VISIBILITY == "public"' # lint.js script makes an API call without authentication when: always +go_fmt: + stage: test + script: + - go fmt ./... + - git diff --exit-code + code_navigation: stage: test image: golang:latest diff --git a/api/pipeline.go b/api/pipeline.go index 86372a67b..5fcb24899 100644 --- a/api/pipeline.go +++ b/api/pipeline.go @@ -179,9 +179,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/commands/api/api.go b/commands/api/api.go index d3ad1f671..76c6e4f6d 100644 --- a/commands/api/api.go +++ b/commands/api/api.go @@ -104,7 +104,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/config/config.go b/commands/config/config.go index 29159fd4c..bbe5f493d 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/mr/rebase/mr_rebase.go b/commands/mr/rebase/mr_rebase.go index 2414c499b..040c06a92 100644 --- a/commands/mr/rebase/mr_rebase.go +++ b/commands/mr/rebase/mr_rebase.go @@ -12,7 +12,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/project/view/project_view.go b/commands/project/view/project_view.go index 016c512c1..38c9e8ae2 100644 --- a/commands/project/view/project_view.go +++ b/commands/project/view/project_view.go @@ -35,9 +35,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/view/view.go b/commands/release/view/view.go index 9179a0585..6d3829fbc 100644 --- a/commands/release/view/view.go +++ b/commands/release/view/view.go @@ -38,7 +38,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/ssh-key/get/get.go b/commands/ssh-key/get/get.go index aa60cff10..87566f023 100644 --- a/commands/ssh-key/get/get.go +++ b/commands/ssh-key/get/get.go @@ -29,7 +29,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 -- GitLab From a8fa22fd978f8fbd05f1288b710c31af28ef814e Mon Sep 17 00:00:00 2001 From: Brian Williams Date: Tue, 15 Nov 2022 15:41:50 -0600 Subject: [PATCH 2/2] Switch to goimports --- .gitlab-ci.yml | 15 +++++++++++---- api/client.go | 1 + api/pipeline.go | 1 + cmd/gen-docs/docs.go | 1 + cmd/glab/main.go | 1 + cmd/glab/main_test.go | 1 + commands/alias/alias_test.go | 1 + commands/alias/delete/alias_delete.go | 1 + commands/alias/delete/alias_delete_test.go | 1 + commands/alias/expand/alias_expand.go | 1 + commands/alias/set/alias_set.go | 1 + commands/alias/set/alias_set_test.go | 1 + commands/api/api.go | 1 + commands/api/api_test.go | 1 + commands/api/http_test.go | 1 + commands/auth/auth.go | 1 + commands/auth/auth_test.go | 1 + commands/auth/login/login.go | 1 + commands/auth/login/login_test.go | 1 + commands/auth/status/status.go | 1 + commands/ci/artifact/artifact.go | 1 + commands/ci/ci_test.go | 1 + commands/ci/get/get.go | 1 + commands/ci/legacyci/pipeline_ci_test.go | 1 + commands/ci/lint/lint_test.go | 1 + commands/ci/trace/trace_test.go | 2 ++ commands/cmdtest/helper.go | 1 + commands/cmdutils/cmdutils.go | 2 ++ commands/cmdutils/cmdutils_test.go | 1 + commands/cmdutils/factory.go | 1 + commands/cmdutils/remote_resolver_test.go | 1 + commands/completion/completion.go | 1 + commands/config/config_test.go | 2 ++ commands/help/help_test.go | 1 + commands/issue/board/board.go | 1 + commands/issue/board/board_test.go | 1 + commands/issue/board/create/issue_board_create.go | 1 + .../issue/board/create/issue_board_create_test.go | 1 + commands/issue/board/view/issue_board_view.go | 1 + commands/issue/close/issue_close.go | 2 ++ commands/issue/close/issue_close_test.go | 2 ++ commands/issue/create/issue_create.go | 2 ++ commands/issue/create/issue_create_test.go | 1 + commands/issue/delete/issue_delete.go | 1 + commands/issue/delete/issue_delete_test.go | 1 + commands/issue/issue.go | 1 + commands/issue/issue_test.go | 1 + commands/issue/issueutils/utils.go | 3 ++- commands/issue/list/issue_list.go | 1 + commands/issue/list/issue_list_test.go | 1 + commands/issue/note/issue_note_create_test.go | 1 + commands/issue/reopen/issue_reopen.go | 1 + commands/issue/subscribe/issue_subscribe.go | 1 + commands/issue/subscribe/issue_subscribe_test.go | 1 + commands/issue/unsubscribe/issue_unsubscribe.go | 1 + .../issue/unsubscribe/issue_unsubscribe_test.go | 1 + commands/issue/update/issue_update_test.go | 1 + commands/issue/view/issue_view_test.go | 1 + commands/label/create/label_create.go | 2 ++ commands/label/label.go | 1 + commands/label/label_test.go | 1 + commands/label/list/label_list.go | 1 + commands/mr/approve/mr_approve.go | 1 + commands/mr/approvers/mr_approvers.go | 1 + commands/mr/checkout/mr_checkout.go | 1 + commands/mr/close/mr_close.go | 1 + commands/mr/create/mr_create.go | 3 +++ commands/mr/create/mr_create_test.go | 2 ++ commands/mr/delete/mr_delete.go | 1 + commands/mr/delete/mr_delete_test.go | 1 + commands/mr/diff/diff_test.go | 2 ++ commands/mr/issues/mr_issues.go | 1 + commands/mr/list/mr_list.go | 1 + commands/mr/list/mr_list_test.go | 1 + commands/mr/merge/mr_merge.go | 2 ++ commands/mr/mr.go | 1 + commands/mr/mr_test.go | 1 + commands/mr/mrutils/mrutils.go | 3 ++- commands/mr/mrutils/mrutils_test.go | 1 + commands/mr/note/mr_note_create_test.go | 1 + commands/mr/rebase/mr_rebase.go | 1 + commands/mr/reopen/mr_reopen.go | 1 + commands/mr/revoke/mr_revoke.go | 1 + commands/mr/subscribe/mr_subscribe.go | 1 + commands/mr/subscribe/mr_subscribe_test.go | 1 + commands/mr/unsubscribe/mr_unsubscribe.go | 1 + commands/mr/unsubscribe/mr_unsubscribe_test.go | 1 + commands/mr/update/mr_update_test.go | 1 + commands/mr/view/mr_view_test.go | 2 ++ commands/project/archive/repo_archive.go | 1 + commands/project/archive/repo_archive_test.go | 1 + commands/project/clone/repo_clone.go | 1 + commands/project/clone/repo_clone_test.go | 2 ++ .../project/contributors/repo_contributors.go | 1 + commands/project/create/project_create.go | 1 + commands/project/delete/delete.go | 1 + commands/project/fork/fork.go | 1 + commands/project/list/list.go | 1 + commands/project/mirror/project_mirror.go | 1 + commands/project/repo_test.go | 1 + commands/project/search/project_search.go | 1 + commands/project/transfer/project_transfer.go | 1 + commands/project/view/project_view.go | 1 + commands/release/create/create.go | 2 ++ commands/release/delete/delete.go | 1 + commands/release/download/download.go | 1 + commands/release/release.go | 1 + commands/release/release_test.go | 1 + commands/release/releaseutils/upload/upload.go | 1 + commands/release/upload/upload.go | 1 + commands/release/view/view.go | 1 + commands/root.go | 1 + commands/root_test.go | 1 + commands/snippet/create/create.go | 1 + commands/snippet/snippet.go | 1 + commands/snippet/snippet_test.go | 1 + commands/ssh-key/add/add.go | 1 + commands/ssh-key/get/get.go | 1 + commands/ssh-key/list/list.go | 1 + commands/ssh-key/ssh-key.go | 1 + commands/user/events/events.go | 1 + commands/user/user.go | 1 + commands/user/user_test.go | 1 + commands/variable/delete/delete.go | 1 + commands/variable/delete/delete_test.go | 2 ++ commands/variable/get/get.go | 1 + commands/variable/get/get_test.go | 1 + commands/variable/list/list.go | 1 + commands/variable/set/set.go | 1 + commands/variable/set/set_test.go | 1 + commands/variable/update/update.go | 1 + commands/variable/update/update_test.go | 1 + commands/variable/variable.go | 1 + commands/variable/variable_test.go | 1 + commands/variable/variableutils/value_test.go | 1 + internal/config/config_test.go | 1 + internal/glrepo/remote_test.go | 1 + internal/glrepo/repo.go | 1 + pkg/iostreams/terminal.go | 3 ++- pkg/surveyext/surveyext.go | 1 + pkg/tableprinter/table_printer.go | 1 + pkg/utils/utils.go | 1 + 142 files changed, 171 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d2363beca..158a31f84 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -74,11 +74,18 @@ lint_commit: - if: '$CI_MERGE_REQUEST_IID && $CI_PROJECT_VISIBILITY == "public"' # lint.js script makes an API call without authentication when: always -go_fmt: - stage: test +goimports: script: - - go fmt ./... - - git diff --exit-code + - 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 diff --git a/api/client.go b/api/client.go index 263f21322..c29d53f08 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 5fcb24899..91a69cdf6 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" ) diff --git a/cmd/gen-docs/docs.go b/cmd/gen-docs/docs.go index 589097f7e..2713bb6b6 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 00d0fd914..f4fbdb7c5 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 7959a8977..9a7bd4544 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 85a03e6ac..daeb5c5fc 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 ea58864a0..28ffea767 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 d015fc455..313c57f2d 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 8dab27a82..bc0be777c 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 d2647fbb2..05d4c7be1 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 252a87cd6..fae01a0e9 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 76c6e4f6d..cfd65ece3 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" diff --git a/commands/api/api_test.go b/commands/api/api_test.go index 6f905bf77..52b771da2 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 9825e3b12..ebfc06535 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 b4dd99270..341b38584 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 935de927c..e5985d71e 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 3464c9000..d244c8ad1 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 faab077bc..419979227 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 9924cbb4e..bcdd90b8f 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 b08dbc554..5a76ec209 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 bcd21e53b..5353ad6f8 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 59cd55dce..eb057eea0 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 ea4fc5ba8..13f6a87c3 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 d897570d4..7e7d8a6f0 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 491c151da..70c328cba 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 646111612..a5d8d5500 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 5b9042fa3..87a040384 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 6b7810fac..627f6234b 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 67e78397a..bdeb34fa9 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 ec1987e11..24a11ff5c 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 a7eeabb87..cf12e49cb 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_test.go b/commands/config/config_test.go index 92739c794..062b67c16 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 c367e2f61..589fa05dd 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 e4eacf44f..8e2fe11dc 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 cd9ed75af..20bd39936 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 93bbfd2a3..5410b3d2b 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 f153b0311..f7e414f2b 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 5c3fd16d2..6f84d2dba 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 9aafa7faa..f966706b1 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 2691123c3..41f2ec1bf 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 37d6eb22b..ad74610b6 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 9e919762e..871432977 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 a48a0e443..def465bf4 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 4d94af7d3..0a960304a 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 15354cbb7..724963e7c 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 c4e1dfc0f..4d44fa484 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 59c45433c..46b00cd46 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 40e561898..8d9aadb93 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 8fbef87e4..ba376fa89 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 3eddfb603..dce23f951 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 5cc3927c4..89a850d88 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 4cb95edff..6524f5742 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 edc391510..cce8f2454 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 aa24ecd90..cd2800796 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 455c13705..52bd60c3a 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 da1c388e6..166aa10f4 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 e8da8c3b1..bf2526888 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 b8cdc6d15..95c84091b 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 bc4ff5537..6069666b7 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 7d9787db8..1a0c37ed5 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 a65d06034..b7d5d14ef 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 56d99630e..02711dfeb 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 b82b5404e..8645f4549 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 2b30789e1..a0a26c535 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 eef0cf4d8..f35484bca 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 87d8fe05a..38c6dd57c 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 1d037817e..740bcf577 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 139b755aa..70d71ad4f 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 a47faf5a1..ce8a64815 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 f6873b057..ee9547ec0 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 a08085755..934f1fe86 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 63c0014c6..776c86e40 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 93ca2987b..cfcf2120d 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 d77e768f5..4a3b42d97 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 2b1925d60..2d4d7a52b 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 facba1476..fcd46baf7 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 babe8932f..6395a37b0 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 dc7c5fdad..b8fa60512 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 93d8ba0d5..b2a121777 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 040c06a92..7ffb1c0b5 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" diff --git a/commands/mr/reopen/mr_reopen.go b/commands/mr/reopen/mr_reopen.go index 5e610dc8d..87ff52233 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 519af2be0..61771afc3 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 f6e4837b7..199c19280 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 9c9141586..125d41adb 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 3330f9ec2..e03f7ae90 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 b14e76677..d999be5d5 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 739632984..6742ea8cc 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 8fe5d78e5..941e6a245 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 7d665d8dc..dbdc9126e 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 a57c7079b..5ac63e676 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 21fa0f161..520724427 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 cbff00c37..1f4efa3b7 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 5dd7caa84..d4d7953c5 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 3bbafd2f9..9e85dc1f4 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 afdf54adc..09030534b 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 a156995cc..456377fdd 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 c10528fcd..f0e17ed11 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 9759cd708..573308473 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 99ec62057..cf1f5d4e6 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 a3d14ab46..788dda049 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 b0a776b8d..6b99fe495 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 38c9e8ae2..3d4e32451 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" diff --git a/commands/release/create/create.go b/commands/release/create/create.go index d6c6ac923..d70ba68b5 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 692fb23f1..e5f5c8076 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 14eb02478..56da1f9ba 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 35230804f..58692d818 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 4c80cb98c..ae9865dc5 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 2abff69a6..923df98f0 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 0af663d49..e933e8341 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 6d3829fbc..6d79d1a9d 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" diff --git a/commands/root.go b/commands/root.go index bcc49f6f9..4489e7056 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 2567d5626..5e719d571 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 69ac995fd..0ee03d3d6 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 9b7ad8e9b..d157f8cb4 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 e56435054..d020a23c7 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 97cef96fe..b0b243202 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 87566f023..9c3981b1c 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" diff --git a/commands/ssh-key/list/list.go b/commands/ssh-key/list/list.go index b8ed37d3d..161e1e158 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 6a279af3e..39c6495c7 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 afec41299..8c045530a 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 51f182bd5..6fdee6f4c 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 94dedb1a9..b2af35097 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 1d6bb35cb..cc406535c 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 abb060243..96bf647a5 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 2a88680b1..9c17da647 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 22da19220..533b6f5c8 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 11621e31e..62fbab891 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 05b218636..55f326e16 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 b717165d6..360a5aae3 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 9e567aa48..4d67fa8a6 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 4f9da44c8..adb17339e 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 aa9bceecf..4189a1fea 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 2d18548d7..214aea714 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 9bd00dc6c..108113a2a 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 8471bd0dd..c4e3113c9 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 9b5967d0a..993d7c06f 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 ef9899705..412081bc1 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 3114a8927..5bca99efc 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 54f4e6d2b..feb5f3b7b 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 8ddb8a430..bb4b87b77 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 3c0e568f4..52ef04e2e 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" ) -- GitLab