From 0e681ca6c4a43c6f33532917ef995d591375c348 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sat, 21 Nov 2020 21:18:50 -0500 Subject: [PATCH 01/11] spelling: beginning --- pkg/cmd/pr/create/regexp_writer_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/pr/create/regexp_writer_test.go b/pkg/cmd/pr/create/regexp_writer_test.go index fd772a760..f9ec0b863 100644 --- a/pkg/cmd/pr/create/regexp_writer_test.go +++ b/pkg/cmd/pr/create/regexp_writer_test.go @@ -93,14 +93,14 @@ func Test_Write(t *testing.T) { { name: "multiple lines removed", input: input{ - in: []string{"begining line\nremove this whole line\nremove this one also\nnot this one"}, + in: []string{"beginning line\nremove this whole line\nremove this one also\nnot this one"}, re: regexp.MustCompile("(?s)^remove.*$"), repl: "", }, output: output{ wantsErr: false, - out: "begining line\nnot this one", - length: 70, + out: "beginning line\nnot this one", + length: 71, }, }, { From e58b2dbe92815222858af49ec0e168a2aae4a253 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sat, 21 Nov 2020 21:18:50 -0500 Subject: [PATCH 02/11] spelling: chestnuts --- pkg/cmd/repo/create/http_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/repo/create/http_test.go b/pkg/cmd/repo/create/http_test.go index c8e2e7a2a..360403538 100644 --- a/pkg/cmd/repo/create/http_test.go +++ b/pkg/cmd/repo/create/http_test.go @@ -17,7 +17,7 @@ func Test_RepoCreate(t *testing.T) { reg.StubResponse(200, bytes.NewBufferString(`{}`)) input := repoCreateInput{ - Description: "roasted chesnuts", + Description: "roasted chestnuts", HomepageURL: "http://example.com", } @@ -39,8 +39,8 @@ func Test_RepoCreate(t *testing.T) { bodyBytes, _ := ioutil.ReadAll(reg.Requests[0].Body) _ = json.Unmarshal(bodyBytes, &reqBody) - if description := reqBody.Variables.Input["description"].(string); description != "roasted chesnuts" { - t.Errorf("expected description to be %q, got %q", "roasted chesnuts", description) + if description := reqBody.Variables.Input["description"].(string); description != "roasted chestnuts" { + t.Errorf("expected description to be %q, got %q", "roasted chestnuts", description) } if homepage := reqBody.Variables.Input["homepageUrl"].(string); homepage != "http://example.com" { t.Errorf("expected homepageUrl to be %q, got %q", "http://example.com", homepage) From 8ba68fc68ada852d8468753dd0a2ffb3c357a110 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sat, 21 Nov 2020 21:18:50 -0500 Subject: [PATCH 03/11] spelling: deprecated --- internal/docs/man_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/docs/man_test.go b/internal/docs/man_test.go index 4e844ad61..58591e19e 100644 --- a/internal/docs/man_test.go +++ b/internal/docs/man_test.go @@ -106,7 +106,7 @@ func TestGenManSeeAlso(t *testing.T) { } } -func TestManPrintFlagsHidesShortDeperecated(t *testing.T) { +func TestManPrintFlagsHidesShortDeprecated(t *testing.T) { c := &cobra.Command{} c.Flags().StringP("foo", "f", "default", "Foo flag") _ = c.Flags().MarkShorthandDeprecated("foo", "don't use it no more") From ddd438d5e14ce696298f684e24e6933b3fe49548 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sat, 21 Nov 2020 21:18:50 -0500 Subject: [PATCH 04/11] spelling: dismissed --- pkg/cmd/pr/view/view.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/pr/view/view.go b/pkg/cmd/pr/view/view.go index 1bb0eff1b..9dcdb8f8b 100644 --- a/pkg/cmd/pr/view/view.go +++ b/pkg/cmd/pr/view/view.go @@ -214,7 +214,7 @@ type reviewerState struct { func formattedReviewerState(cs *iostreams.ColorScheme, reviewer *reviewerState) string { state := reviewer.State if state == dismissedReviewState { - // Show "DISMISSED" review as "COMMENTED", since "dimissed" only makes + // Show "DISMISSED" review as "COMMENTED", since "dismissed" only makes // sense when displayed in an events timeline but not in the final tally. state = commentedReviewState } From 861d350440ca0ba866c4651351b29afb939124a2 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sat, 21 Nov 2020 21:18:50 -0500 Subject: [PATCH 05/11] spelling: dunno --- pkg/cmd/pr/review/review_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/pr/review/review_test.go b/pkg/cmd/pr/review/review_test.go index b96ab8089..2184c264c 100644 --- a/pkg/cmd/pr/review/review_test.go +++ b/pkg/cmd/pr/review/review_test.go @@ -319,7 +319,7 @@ func TestPRReview(t *testing.T) { {`--request-changes -b"bad"`, "REQUEST_CHANGES", "bad"}, {`--approve`, "APPROVE", ""}, {`--approve -b"hot damn"`, "APPROVE", "hot damn"}, - {`--comment --body "i donno"`, "COMMENT", "i donno"}, + {`--comment --body "i dunno"`, "COMMENT", "i dunno"}, } for _, kase := range cases { From 76bd3772530f09de9b2d40f480c63a6d6427f410 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sat, 21 Nov 2020 21:18:51 -0500 Subject: [PATCH 06/11] spelling: error --- pkg/cmd/root/help.go | 2 +- pkg/cmd/root/root.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/root/help.go b/pkg/cmd/root/help.go index a3be5a27a..80b61341e 100644 --- a/pkg/cmd/root/help.go +++ b/pkg/cmd/root/help.go @@ -35,7 +35,7 @@ func rootUsageFunc(command *cobra.Command) error { return nil } -func rootFlagErrrorFunc(cmd *cobra.Command, err error) error { +func rootFlagErrorFunc(cmd *cobra.Command, err error) error { if err == pflag.ErrHelp { return err } diff --git a/pkg/cmd/root/root.go b/pkg/cmd/root/root.go index 93cb4431d..42c1b627f 100644 --- a/pkg/cmd/root/root.go +++ b/pkg/cmd/root/root.go @@ -59,7 +59,7 @@ func NewCmdRoot(f *cmdutil.Factory, version, buildDate string) *cobra.Command { cmd.PersistentFlags().Bool("help", false, "Show help for command") cmd.SetHelpFunc(helpHelper) cmd.SetUsageFunc(rootUsageFunc) - cmd.SetFlagErrorFunc(rootFlagErrrorFunc) + cmd.SetFlagErrorFunc(rootFlagErrorFunc) formattedVersion := versionCmd.Format(version, buildDate) cmd.SetVersionTemplate(formattedVersion) From c8b9486fd3ac6a1692965013d1685e66cb197bfe Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sat, 21 Nov 2020 21:18:51 -0500 Subject: [PATCH 07/11] spelling: nonexistent --- context/remote_test.go | 4 ++-- git/ssh_config_test.go | 2 +- internal/config/config_file_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/context/remote_test.go b/context/remote_test.go index ab3f7e2e2..1d2140c90 100644 --- a/context/remote_test.go +++ b/context/remote_test.go @@ -28,11 +28,11 @@ func Test_Remotes_FindByName(t *testing.T) { eq(t, err, nil) eq(t, r.Name, "upstream") - r, err = list.FindByName("nonexist", "*") + r, err = list.FindByName("nonexistent", "*") eq(t, err, nil) eq(t, r.Name, "mona") - _, err = list.FindByName("nonexist") + _, err = list.FindByName("nonexistent") eq(t, err, errors.New(`no GitHub remotes found`)) } diff --git a/git/ssh_config_test.go b/git/ssh_config_test.go index 28f339aa6..7aafc5b21 100644 --- a/git/ssh_config_test.go +++ b/git/ssh_config_test.go @@ -25,7 +25,7 @@ func Test_sshParse(t *testing.T) { `)) eq(t, m["foo"], "example.com") eq(t, m["bar"], "%bar.net%") - eq(t, m["nonexist"], "") + eq(t, m["nonexistent"], "") } func Test_Translator(t *testing.T) { diff --git a/internal/config/config_file_test.go b/internal/config/config_file_test.go index f40cb9097..cc6ba287f 100644 --- a/internal/config/config_file_test.go +++ b/internal/config/config_file_test.go @@ -90,7 +90,7 @@ example.com: val, err = config.Get("github.com", "git_protocol") eq(t, err, nil) eq(t, val, "ssh") - val, err = config.Get("nonexist.io", "git_protocol") + val, err = config.Get("nonexistent.io", "git_protocol") eq(t, err, nil) eq(t, val, "ssh") } From e5f59a15fe6de03de0c17b8ec1ed004bf8c5afc6 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sat, 21 Nov 2020 21:18:51 -0500 Subject: [PATCH 08/11] spelling: response --- api/cache.go | 6 +++--- api/cache_test.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/cache.go b/api/cache.go index 620660c15..1f6d8896b 100644 --- a/api/cache.go +++ b/api/cache.go @@ -19,7 +19,7 @@ import ( func makeCachedClient(httpClient *http.Client, cacheTTL time.Duration) *http.Client { cacheDir := filepath.Join(os.TempDir(), "gh-cli-cache") return &http.Client{ - Transport: CacheReponse(cacheTTL, cacheDir)(httpClient.Transport), + Transport: CacheResponse(cacheTTL, cacheDir)(httpClient.Transport), } } @@ -39,8 +39,8 @@ func isCacheableResponse(res *http.Response) bool { return res.StatusCode < 500 && res.StatusCode != 403 } -// CacheReponse produces a RoundTripper that caches HTTP responses to disk for a specified amount of time -func CacheReponse(ttl time.Duration, dir string) ClientOption { +// CacheResponse produces a RoundTripper that caches HTTP responses to disk for a specified amount of time +func CacheResponse(ttl time.Duration, dir string) ClientOption { fs := fileStorage{ dir: dir, ttl: ttl, diff --git a/api/cache_test.go b/api/cache_test.go index d1039d71b..f4a6a756e 100644 --- a/api/cache_test.go +++ b/api/cache_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/require" ) -func Test_CacheReponse(t *testing.T) { +func Test_CacheResponse(t *testing.T) { counter := 0 fakeHTTP := funcTripper{ roundTrip: func(req *http.Request) (*http.Response, error) { @@ -32,7 +32,7 @@ func Test_CacheReponse(t *testing.T) { } cacheDir := filepath.Join(t.TempDir(), "gh-cli-cache") - httpClient := NewHTTPClient(ReplaceTripper(fakeHTTP), CacheReponse(time.Minute, cacheDir)) + httpClient := NewHTTPClient(ReplaceTripper(fakeHTTP), CacheResponse(time.Minute, cacheDir)) do := func(method, url string, body io.Reader) (string, error) { req, err := http.NewRequest(method, url, body) From ec82d3c47e5b2340df8ccbda074ec2120b0c25fe Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sat, 21 Nov 2020 21:18:51 -0500 Subject: [PATCH 09/11] spelling: settings --- pkg/cmd/repo/garden/garden.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/repo/garden/garden.go b/pkg/cmd/repo/garden/garden.go index 359d8d898..c7ee048a7 100644 --- a/pkg/cmd/repo/garden/garden.go +++ b/pkg/cmd/repo/garden/garden.go @@ -190,7 +190,7 @@ func gardenRun(opts *GardenOptions) error { oldTTYCommand := exec.Command("stty", sttyFileArg, "/dev/tty", "-g") oldTTYSettings, err := oldTTYCommand.CombinedOutput() if err != nil { - fmt.Fprintln(out, "getting TTY setings failed:", string(oldTTYSettings)) + fmt.Fprintln(out, "getting TTY settings failed:", string(oldTTYSettings)) return err } From ded92972cd684f95f2e35ad3ee20f3f28a71bd86 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sat, 21 Nov 2020 21:18:51 -0500 Subject: [PATCH 10/11] spelling: template --- pkg/cmd/issue/create/create_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/issue/create/create_test.go b/pkg/cmd/issue/create/create_test.go index c89a349a0..0ced19b62 100644 --- a/pkg/cmd/issue/create/create_test.go +++ b/pkg/cmd/issue/create/create_test.go @@ -145,7 +145,7 @@ func TestIssueCreate_nonLegacyTemplate(t *testing.T) { as, teardown := prompt.InitAskStubber() defer teardown() - // tmeplate + // template as.Stub([]*prompt.QuestionStub{ { Name: "index", From a66a65d4220b970af61b27fbe7ce9b4b62c0c7ba Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sat, 21 Nov 2020 21:18:52 -0500 Subject: [PATCH 11/11] spelling: unmatched --- internal/run/stub.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/run/stub.go b/internal/run/stub.go index 9bd6e279b..f11834c19 100644 --- a/internal/run/stub.go +++ b/internal/run/stub.go @@ -39,7 +39,7 @@ func Stub() (*CommandStubber, func(T)) { return } t.Helper() - t.Errorf("umatched stubs (%d): %s", len(unmatched), strings.Join(unmatched, ", ")) + t.Errorf("unmatched stubs (%d): %s", len(unmatched), strings.Join(unmatched, ", ")) } }