From d366bbf11dd88e11a8452d394d7755cc12a0a6be Mon Sep 17 00:00:00 2001 From: myersg86 Date: Fri, 15 Apr 2022 09:33:26 -0600 Subject: [PATCH] Fixes typos in docs, error msgs, comments, code --- README.md | 2 +- api/snippets.go | 8 ++++---- commands/ci/view/view.go | 2 +- commands/cmdutils/cmdutils.go | 2 +- commands/mr/list/mr_list.go | 2 +- commands/mr/mrutils/mrutils.go | 2 +- commands/mr/mrutils/mrutils_test.go | 2 +- commands/project/create/project_create.go | 12 ++++++------ commands/root.go | 2 +- docs/source/mr/list.rst | 2 +- internal/config/writefile_test.go | 2 +- internal/glrepo/resolver.go | 2 +- pkg/git/url_test.go | 2 +- pkg/tableprinter/table_printer.go | 2 +- 14 files changed, 22 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 4657230d..91a879d2 100644 --- a/README.md +++ b/README.md @@ -340,7 +340,7 @@ glab config set editor vim --host gitlab.example.org NO_COLOR: set to any value to avoid printing ANSI escape sequences for color output. - FORCE_HYPERLINKS: set to 1 to force hyperlinks to be output, even when not outputing to a TTY + FORCE_HYPERLINKS: set to 1 to force hyperlinks to be output, even when not outputting to a TTY ``` ## What about [Lab]? diff --git a/api/snippets.go b/api/snippets.go index 2c8055d3..3da4112c 100644 --- a/api/snippets.go +++ b/api/snippets.go @@ -12,11 +12,11 @@ var CreateSnippet = func( client = apiClient.Lab() } - snipet, _, err := client.Snippets.CreateSnippet(opts) + snippet, _, err := client.Snippets.CreateSnippet(opts) if err != nil { return nil, err } - return snipet, err + return snippet, err } // CreateProjectSnippet inside the project @@ -29,9 +29,9 @@ var CreateProjectSnippet = func( client = apiClient.Lab() } - snipet, _, err := client.ProjectSnippets.CreateSnippet(projectID, opts) + snippet, _, err := client.ProjectSnippets.CreateSnippet(projectID, opts) if err != nil { return nil, err } - return snipet, err + return snippet, err } diff --git a/commands/ci/view/view.go b/commands/ci/view/view.go index 55f8c131..8d5d3b00 100644 --- a/commands/ci/view/view.go +++ b/commands/ci/view/view.go @@ -624,7 +624,7 @@ func link(screen tcell.Screen, v1 *tview.Box, v2 *tview.Box, padding int, firstS if dx != 0 { hline(screen, x1+w, y2+h/2, dx-w) if dy != 0 { - // dy != 0 means the last stage had multple jobs + // dy != 0 means the last stage had multiple jobs screen.SetContent(x1+w+p-1, y2+h/2, '╦', nil, tcell.StyleDefault) } return diff --git a/commands/cmdutils/cmdutils.go b/commands/cmdutils/cmdutils.go index b819c5ee..17d9ef00 100644 --- a/commands/cmdutils/cmdutils.go +++ b/commands/cmdutils/cmdutils.go @@ -35,7 +35,7 @@ const ( // Follows the format officially supported by GitLab // https://docs.gitlab.com/ee/user/project/description_templates.html#setting-a-default-template-for-issues-and-merge-requests. // -// TODO: load from remote repository if repo is overriden by -R flag +// TODO: load from remote repository if repo is overridden by -R flag func LoadGitLabTemplate(tmplType, tmplName string) (string, error) { wdir, err := git.ToplevelDir() if err != nil { diff --git a/commands/mr/list/mr_list.go b/commands/mr/list/mr_list.go index 655aaa8c..b81d430a 100644 --- a/commands/mr/list/mr_list.go +++ b/commands/mr/list/mr_list.go @@ -115,7 +115,7 @@ func NewCmdList(f *cmdutils.Factory, runE func(opts *ListOptions) error) *cobra. mrListCmd.Flags().StringSliceVarP(&opts.Labels, "label", "l", []string{}, "Filter merge request by label ") mrListCmd.Flags().StringSliceVar(&opts.NotLabels, "not-label", []string{}, "Filter merge requests by not having label ") - mrListCmd.Flags().StringVar(&opts.Author, "author", "", "Fitler merge request by Author ") + mrListCmd.Flags().StringVar(&opts.Author, "author", "", "Filter merge request by Author ") mrListCmd.Flags().StringVarP(&opts.Milestone, "milestone", "m", "", "Filter merge request by milestone ") mrListCmd.Flags().StringVarP(&opts.SourceBranch, "source-branch", "s", "", "Filter by source branch ") mrListCmd.Flags().StringVarP(&opts.TargetBranch, "target-branch", "t", "", "Filter by target branch ") diff --git a/commands/mr/mrutils/mrutils.go b/commands/mr/mrutils/mrutils.go index 04ef79db..ab4f4d88 100644 --- a/commands/mr/mrutils/mrutils.go +++ b/commands/mr/mrutils/mrutils.go @@ -74,7 +74,7 @@ func MRCheckErrors(mr *gitlab.MergeRequest, err MRCheckErrOptions) error { } if err.MergePrivilege && !mr.User.CanMerge { - return fmt.Errorf("you do not have enough priviledges to merge this merge request") + return fmt.Errorf("you do not have enough privileges to merge this merge request") } if err.Conflict && mr.HasConflicts { diff --git a/commands/mr/mrutils/mrutils_test.go b/commands/mr/mrutils/mrutils_test.go index 1b6437fb..46ceb0fb 100644 --- a/commands/mr/mrutils/mrutils_test.go +++ b/commands/mr/mrutils/mrutils_test.go @@ -178,7 +178,7 @@ func Test_MRCheckErrors(t *testing.T) { errOpts: MRCheckErrOptions{ MergePrivilege: true, }, - output: "you do not have enough priviledges to merge this merge request", + output: "you do not have enough privileges to merge this merge request", }, { name: "conflicts", diff --git a/commands/project/create/project_create.go b/commands/project/create/project_create.go index 93db65d1..a5701cca 100644 --- a/commands/project/create/project_create.go +++ b/commands/project/create/project_create.go @@ -61,7 +61,7 @@ func NewCmdCreate(f *cmdutils.Factory) *cobra.Command { func runCreateProject(cmd *cobra.Command, args []string, f *cmdutils.Factory) error { var ( projectPath string - visiblity gitlab.VisibilityValue + visibility gitlab.VisibilityValue err error isPath bool namespaceID int @@ -141,11 +141,11 @@ func runCreateProject(cmd *cobra.Command, args []string, f *cmdutils.Factory) er description, _ := cmd.Flags().GetString("description") if internal, _ := cmd.Flags().GetBool("internal"); internal { - visiblity = gitlab.InternalVisibility + visibility = gitlab.InternalVisibility } else if private, _ := cmd.Flags().GetBool("private"); private { - visiblity = gitlab.PrivateVisibility + visibility = gitlab.PrivateVisibility } else if public, _ := cmd.Flags().GetBool("public"); public { - visiblity = gitlab.PublicVisibility + visibility = gitlab.PublicVisibility } tags, _ := cmd.Flags().GetStringArray("tag") @@ -160,8 +160,8 @@ func runCreateProject(cmd *cobra.Command, args []string, f *cmdutils.Factory) er InitializeWithReadme: gitlab.Bool(readme), } - if visiblity != "" { - opts.Visibility = &visiblity + if visibility != "" { + opts.Visibility = &visibility } if namespaceID != 0 { diff --git a/commands/root.go b/commands/root.go index 3af92f7f..e13574f5 100644 --- a/commands/root.go +++ b/commands/root.go @@ -62,7 +62,7 @@ func NewCmdRoot(f *cmdutils.Factory, version, buildDate string) *cobra.Command { NO_COLOR: set to any value to avoid printing ANSI escape sequences for color output. - FORCE_HYPERLINKS: set to 1 to force hyperlinks to be output, even when not outputing to a TTY + FORCE_HYPERLINKS: set to 1 to force hyperlinks to be output, even when not outputting to a TTY GLAB_CONFIG_DIR: set to a directory path to override the global configuration location `), diff --git a/docs/source/mr/list.rst b/docs/source/mr/list.rst index 546d3e0a..408e03d8 100644 --- a/docs/source/mr/list.rst +++ b/docs/source/mr/list.rst @@ -39,7 +39,7 @@ Options -A, --all Get all merge requests -a, --assignee strings Get only merge requests assigned to users - --author string Fitler merge request by Author + --author string Filter merge request by Author -c, --closed Get only closed merge requests -d, --draft Filter by draft merge requests -g, --group string Get MRs from group and it's subgroups diff --git a/internal/config/writefile_test.go b/internal/config/writefile_test.go index 8660ad4f..9fa1c7ab 100644 --- a/internal/config/writefile_test.go +++ b/internal/config/writefile_test.go @@ -14,7 +14,7 @@ import ( func Test_WriteFile(t *testing.T) { dir, err := ioutil.TempDir("", "") if err != nil { - t.Skipf("unexpected error while creating temporay directory = %s", err) + t.Skipf("unexpected error while creating temporary directory = %s", err) } t.Cleanup(func() { os.RemoveAll(dir) diff --git a/internal/glrepo/resolver.go b/internal/glrepo/resolver.go index 6072a533..45060b11 100644 --- a/internal/glrepo/resolver.go +++ b/internal/glrepo/resolver.go @@ -89,7 +89,7 @@ func (r *ResolvedRemotes) BaseRepo(interactive bool) (Interface, error) { } // Rewrite resolution, ignore the error as this will keep working // in the future we might add a warning that we couldn't rewrite - // it for compatiblity + // it for compatibility _ = git.SetRemoteResolution(r.Name, "base:"+r.Resolved) return NewWithHost(repo.RepoOwner(), repo.RepoName(), r.RepoHost()), nil diff --git a/pkg/git/url_test.go b/pkg/git/url_test.go index e158b136..87b4a3f8 100644 --- a/pkg/git/url_test.go +++ b/pkg/git/url_test.go @@ -188,7 +188,7 @@ func TestParseURL(t *testing.T) { } } else { if err != nil { - t.Errorf("unexpcted error %s", err) + t.Errorf("unexpected error %s", err) } if u.Scheme != tt.want.Scheme { t.Errorf("expected scheme %q, got %q", tt.want.Scheme, u.Scheme) diff --git a/pkg/tableprinter/table_printer.go b/pkg/tableprinter/table_printer.go index f8bf3352..bb049b9b 100644 --- a/pkg/tableprinter/table_printer.go +++ b/pkg/tableprinter/table_printer.go @@ -54,7 +54,7 @@ type TableCell struct { type TableRow struct { Cells []*TableCell - // Separator is the seperator for columns in the table. Default is " " + // Separator is the separator for columns in the table. Default is " " Separator string }