diff --git a/api/sanitize_ascii.go b/api/sanitize_ascii.go index aeedaccbf..75cb3062b 100644 --- a/api/sanitize_ascii.go +++ b/api/sanitize_ascii.go @@ -47,9 +47,9 @@ type sanitizer struct { addEscape bool } -// Transform uses a sliding window alogorithm to detect C0 and C1 +// Transform uses a sliding window algorithm to detect C0 and C1 // ASCII control sequences as they are read and replaces them -// with equivelent inert characters. Characters that are not part +// with equivalent inert characters. Characters that are not part // of a control sequence are not modified. func (t *sanitizer) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { lSrc := len(src) diff --git a/git/client_test.go b/git/client_test.go index 68cfc2739..6bbeee27e 100644 --- a/git/client_test.go +++ b/git/client_test.go @@ -303,7 +303,7 @@ func TestClientCurrentBranch(t *testing.T) { wantBranch: "branch\u00A0with\u00A0non\u00A0breaking\u00A0space", }, { - name: "detatched head", + name: "detached head", cmdExitStatus: 1, wantCmdArgs: `path/to/git symbolic-ref --quiet HEAD`, wantErrorMsg: "failed to run git: not on any branch", @@ -339,7 +339,7 @@ func TestClientShowRefs(t *testing.T) { wantErrorMsg string }{ { - name: "show refs with one vaid ref and one invalid ref", + name: "show refs with one valid ref and one invalid ref", cmdExitStatus: 128, cmdStdout: "9ea76237a557015e73446d33268569a114c0649c refs/heads/valid", cmdStderr: "fatal: 'refs/heads/invalid' - not a valid ref", diff --git a/internal/codespaces/api/api.go b/internal/codespaces/api/api.go index 0f7c71aa9..667a9c3dc 100644 --- a/internal/codespaces/api/api.go +++ b/internal/codespaces/api/api.go @@ -122,7 +122,7 @@ func (a *API) GetUser(ctx context.Context) (*User, error) { var response User if err := json.Unmarshal(b, &response); err != nil { - return nil, fmt.Errorf("error unmarshaling response: %w", err) + return nil, fmt.Errorf("error unmarshalling response: %w", err) } return &response, nil @@ -160,7 +160,7 @@ func (a *API) GetRepository(ctx context.Context, nwo string) (*Repository, error var response Repository if err := json.Unmarshal(b, &response); err != nil { - return nil, fmt.Errorf("error unmarshaling response: %w", err) + return nil, fmt.Errorf("error unmarshalling response: %w", err) } return &response, nil @@ -336,7 +336,7 @@ func (a *API) ListCodespaces(ctx context.Context, opts ListCodespacesOptions) (c dec := json.NewDecoder(resp.Body) if err := dec.Decode(&response); err != nil { - return nil, fmt.Errorf("error unmarshaling response: %w", err) + return nil, fmt.Errorf("error unmarshalling response: %w", err) } nextURL := findNextPage(resp.Header.Get("Link")) @@ -398,7 +398,7 @@ func (a *API) GetOrgMemberCodespace(ctx context.Context, orgName string, userNam dec := json.NewDecoder(resp.Body) if err := dec.Decode(&response); err != nil { - return nil, fmt.Errorf("error unmarshaling response: %w", err) + return nil, fmt.Errorf("error unmarshalling response: %w", err) } for _, cs := range response.Codespaces { @@ -455,7 +455,7 @@ func (a *API) GetCodespace(ctx context.Context, codespaceName string, includeCon var response Codespace if err := json.Unmarshal(b, &response); err != nil { - return nil, fmt.Errorf("error unmarshaling response: %w", err) + return nil, fmt.Errorf("error unmarshalling response: %w", err) } return &response, nil @@ -563,7 +563,7 @@ func (a *API) GetCodespacesMachines(ctx context.Context, repoID int, branch, loc Machines []*Machine `json:"machines"` } if err := json.Unmarshal(b, &response); err != nil { - return nil, fmt.Errorf("error unmarshaling response: %w", err) + return nil, fmt.Errorf("error unmarshalling response: %w", err) } return response.Machines, nil @@ -636,7 +636,7 @@ func (a *API) GetCodespaceRepoSuggestions(ctx context.Context, partialSearch str Items []*Repository `json:"items"` } if err := json.Unmarshal(b, &response); err != nil { - return nil, fmt.Errorf("error unmarshaling response: %w", err) + return nil, fmt.Errorf("error unmarshalling response: %w", err) } repoNames := make([]string, len(response.Items)) @@ -683,7 +683,7 @@ func (a *API) GetCodespaceBillableOwner(ctx context.Context, nwo string) (*User, } } if err := json.Unmarshal(b, &response); err != nil { - return nil, fmt.Errorf("error unmarshaling response: %w", err) + return nil, fmt.Errorf("error unmarshalling response: %w", err) } // While this response contains further helpful information ahead of codespace creation, @@ -815,7 +815,7 @@ func (a *API) startCreate(ctx context.Context, params *CreateCodespaceParams) (* var response Codespace if err := json.Unmarshal(b, &response); err != nil { - return nil, fmt.Errorf("error unmarshaling response: %w", err) + return nil, fmt.Errorf("error unmarshalling response: %w", err) } return &response, errProvisioningInProgress // RPC finished before result of creation known @@ -831,7 +831,7 @@ func (a *API) startCreate(ctx context.Context, params *CreateCodespaceParams) (* return nil, fmt.Errorf("error reading response body: %w", err) } if err := json.Unmarshal(b, &ue); err != nil { - return nil, fmt.Errorf("error unmarshaling response: %w", err) + return nil, fmt.Errorf("error unmarshalling response: %w", err) } if ue.AllowPermissionsURL != "" { @@ -853,7 +853,7 @@ func (a *API) startCreate(ctx context.Context, params *CreateCodespaceParams) (* var response Codespace if err := json.Unmarshal(b, &response); err != nil { - return nil, fmt.Errorf("error unmarshaling response: %w", err) + return nil, fmt.Errorf("error unmarshalling response: %w", err) } return &response, nil @@ -934,7 +934,7 @@ func (a *API) ListDevContainers(ctx context.Context, repoID int, branch string, dec := json.NewDecoder(resp.Body) if err := dec.Decode(&response); err != nil { - return nil, fmt.Errorf("error unmarshaling response: %w", err) + return nil, fmt.Errorf("error unmarshalling response: %w", err) } nextURL := findNextPage(resp.Header.Get("Link")) @@ -1007,7 +1007,7 @@ func (a *API) EditCodespace(ctx context.Context, codespaceName string, params *E var response Codespace if err := json.Unmarshal(b, &response); err != nil { - return nil, fmt.Errorf("error unmarshaling response: %w", err) + return nil, fmt.Errorf("error unmarshalling response: %w", err) } return &response, nil @@ -1055,7 +1055,7 @@ func (a *API) GetCodespaceRepositoryContents(ctx context.Context, codespace *Cod var response getCodespaceRepositoryContentsResponse if err := json.Unmarshal(b, &response); err != nil { - return nil, fmt.Errorf("error unmarshaling response: %w", err) + return nil, fmt.Errorf("error unmarshalling response: %w", err) } decoded, err := base64.StdEncoding.DecodeString(response.Content) diff --git a/internal/codespaces/api/api_test.go b/internal/codespaces/api/api_test.go index e8fab74f1..5e9316fc1 100644 --- a/internal/codespaces/api/api_test.go +++ b/internal/codespaces/api/api_test.go @@ -21,7 +21,7 @@ func generateCodespaceList(start int, end int) []*Codespace { return codespacesList } -func createFakeListEndpointServer(t *testing.T, initalTotal int, finalTotal int) *httptest.Server { +func createFakeListEndpointServer(t *testing.T, initialTotal int, finalTotal int) *httptest.Server { return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.URL.Path != "/user/codespaces" { t.Fatal("Incorrect path") @@ -48,7 +48,7 @@ func createFakeListEndpointServer(t *testing.T, initalTotal int, finalTotal int) switch page { case 1: response.Codespaces = generateCodespaceList(0, per_page) - response.TotalCount = initalTotal + response.TotalCount = initialTotal w.Header().Set("Link", fmt.Sprintf(`; rel="last", ; rel="next"`, r.Host, per_page)) case 2: response.Codespaces = generateCodespaceList(per_page, per_page*2) diff --git a/internal/config/config.go b/internal/config/config.go index f86e566c7..02756dad5 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -124,7 +124,7 @@ type AuthConfig struct { // Token will retrieve the auth token for the given hostname, // searching environment variables, plain text config, and -// lastly encypted storage. +// lastly encrypted storage. func (c *AuthConfig) Token(hostname string) (string, string) { if c.tokenOverride != nil { return c.tokenOverride(hostname) diff --git a/pkg/cmd/browse/browse_test.go b/pkg/cmd/browse/browse_test.go index 4995e5cdf..616c1f7e4 100644 --- a/pkg/cmd/browse/browse_test.go +++ b/pkg/cmd/browse/browse_test.go @@ -369,7 +369,7 @@ func Test_runBrowse(t *testing.T) { opts: BrowseOptions{ SelectorArg: "chocolate-pecan-pie.txt", }, - baseRepo: ghrepo.New("andrewhsu", "recipies"), + baseRepo: ghrepo.New("andrewhsu", "recipes"), defaultBranch: "", wantsErr: true, }, diff --git a/pkg/cmd/codespace/ports.go b/pkg/cmd/codespace/ports.go index 7b697ffdb..cbe48b7b3 100644 --- a/pkg/cmd/codespace/ports.go +++ b/pkg/cmd/codespace/ports.go @@ -214,7 +214,7 @@ func getDevContainer(ctx context.Context, apiClient apiClient, codespace *api.Co var container devContainer if err := json.Unmarshal(convertedJSON, &container); err != nil { - ch <- devContainerResult{nil, fmt.Errorf("error unmarshaling: %w", err)} + ch <- devContainerResult{nil, fmt.Errorf("error unmarshalling: %w", err)} return } diff --git a/pkg/cmd/codespace/ports_test.go b/pkg/cmd/codespace/ports_test.go index 9979345b2..bb7554238 100644 --- a/pkg/cmd/codespace/ports_test.go +++ b/pkg/cmd/codespace/ports_test.go @@ -225,7 +225,7 @@ func TestPendingOperationDisallowsListPorts(t *testing.T) { } } -func TestPendingOperationDisallowsUpdatePortVisability(t *testing.T) { +func TestPendingOperationDisallowsUpdatePortVisibility(t *testing.T) { app := testingPortsApp() selector := &CodespaceSelector{api: app.apiClient, codespaceName: "disabledCodespace"} diff --git a/pkg/cmd/extension/manager_test.go b/pkg/cmd/extension/manager_test.go index 4f8b3d75d..b3fe64567 100644 --- a/pkg/cmd/extension/manager_test.go +++ b/pkg/cmd/extension/manager_test.go @@ -713,7 +713,7 @@ func TestManager_UpgradeExtension_BinaryExtension_Pinned(t *testing.T) { assert.Equal(t, err, pinnedExtensionUpgradeError) } -func TestManager_UpgradeExtenion_GitExtension_Pinned(t *testing.T) { +func TestManager_UpgradeExtension_GitExtension_Pinned(t *testing.T) { tempDir := t.TempDir() extDir := filepath.Join(tempDir, "extensions", "gh-remote") assert.NoError(t, stubPinnedExtension(filepath.Join(extDir, "gh-remote"), "abcd1234")) diff --git a/pkg/cmd/pr/merge/merge.go b/pkg/cmd/pr/merge/merge.go index 1a331597c..d49139011 100644 --- a/pkg/cmd/pr/merge/merge.go +++ b/pkg/cmd/pr/merge/merge.go @@ -477,7 +477,7 @@ func (m *mergeContext) infof(format string, args ...interface{}) error { return err } -// Creates a new MergeConext from MergeOptions. +// Creates a new MergeContext from MergeOptions. func NewMergeContext(opts *MergeOptions) (*mergeContext, error) { findOptions := shared.FindOptions{ Selector: opts.SelectorArg, diff --git a/pkg/cmd/pr/shared/editable_http.go b/pkg/cmd/pr/shared/editable_http.go index 3353cd5f5..fcc30095a 100644 --- a/pkg/cmd/pr/shared/editable_http.go +++ b/pkg/cmd/pr/shared/editable_http.go @@ -35,7 +35,7 @@ func UpdateIssue(httpClient *http.Client, repo ghrepo.Interface, id string, isPR } } - // updateIssue mutation does not support ProjectsV2 so do them in a seperate request. + // updateIssue mutation does not support ProjectsV2 so do them in a separate request. if options.Projects.Edited { wg.Go(func() error { apiClient := api.NewClientFromHTTP(httpClient) diff --git a/pkg/cmd/repo/delete/delete.go b/pkg/cmd/repo/delete/delete.go index f6f1e87ca..1e96e404d 100644 --- a/pkg/cmd/repo/delete/delete.go +++ b/pkg/cmd/repo/delete/delete.go @@ -114,7 +114,7 @@ func deleteRun(opts *DeleteOptions) error { statusCode == http.StatusTemporaryRedirect || statusCode == http.StatusPermanentRedirect { cs := opts.IO.ColorScheme() - fmt.Fprintf(opts.IO.ErrOut, "%s Failed to delete repository: %s has changed name or transfered ownership\n", cs.FailureIcon(), fullName) + fmt.Fprintf(opts.IO.ErrOut, "%s Failed to delete repository: %s has changed name or transferred ownership\n", cs.FailureIcon(), fullName) return cmdutil.SilentError } } diff --git a/pkg/cmd/repo/delete/delete_test.go b/pkg/cmd/repo/delete/delete_test.go index 16b2b4006..b52ac1de9 100644 --- a/pkg/cmd/repo/delete/delete_test.go +++ b/pkg/cmd/repo/delete/delete_test.go @@ -157,11 +157,11 @@ func Test_deleteRun(t *testing.T) { }, }, { - name: "repo transfered ownership", + name: "repo transferred ownership", opts: &DeleteOptions{RepoArg: "OWNER/REPO", Confirmed: true}, wantErr: true, errMsg: "SilentError", - wantStderr: "X Failed to delete repository: OWNER/REPO has changed name or transfered ownership\n", + wantStderr: "X Failed to delete repository: OWNER/REPO has changed name or transferred ownership\n", httpStubs: func(reg *httpmock.Registry) { reg.Register( httpmock.REST("DELETE", "repos/OWNER/REPO"), diff --git a/pkg/cmd/run/view/view.go b/pkg/cmd/run/view/view.go index 34c5fcbc7..5cb265b55 100644 --- a/pkg/cmd/run/view/view.go +++ b/pkg/cmd/run/view/view.go @@ -503,7 +503,7 @@ func logFilenameRegexp(job shared.Job, step shared.Step) *regexp.Regexp { // ├── 1_stepname.txt // └── 2_somestepname.txt // -// It iterates through the list of jobs and trys to find the matching +// It iterates through the list of jobs and tries to find the matching // log in the zip file. If the matching log is found it is attached // to the job. func attachRunLog(rlz *zip.ReadCloser, jobs []shared.Job) { diff --git a/pkg/cmd/status/status.go b/pkg/cmd/status/status.go index cf927d40f..7e39d63d0 100644 --- a/pkg/cmd/status/status.go +++ b/pkg/cmd/status/status.go @@ -467,7 +467,7 @@ func (s *StatusGetter) LoadSearchResults() error { case "PullRequest": prs = append(prs, *node) default: - return fmt.Errorf("unkown Assignments type: %q", node.Type) + return fmt.Errorf("unknown Assignments type: %q", node.Type) } } diff --git a/pkg/liveshare/client_test.go b/pkg/liveshare/client_test.go index a39c48f7b..4ccc42729 100644 --- a/pkg/liveshare/client_test.go +++ b/pkg/liveshare/client_test.go @@ -24,7 +24,7 @@ func TestConnect(t *testing.T) { joinWorkspace := func(conn *jsonrpc2.Conn, req *jsonrpc2.Request) (interface{}, error) { var joinWorkspaceReq joinWorkspaceArgs if err := json.Unmarshal(*req.Params, &joinWorkspaceReq); err != nil { - return nil, fmt.Errorf("error unmarshaling req: %w", err) + return nil, fmt.Errorf("error unmarshalling req: %w", err) } if joinWorkspaceReq.ID != opts.SessionID { return nil, errors.New("connection session id does not match") diff --git a/pkg/liveshare/ports.go b/pkg/liveshare/ports.go index 6cef1584b..b39a4f630 100644 --- a/pkg/liveshare/ports.go +++ b/pkg/liveshare/ports.go @@ -52,7 +52,7 @@ func (s *Session) WaitForPortNotification(ctx context.Context, port int, notifTy notification := new(PortNotification) if err := json.Unmarshal(*req.Params, ¬ification); err != nil { select { - case errCh <- fmt.Errorf("error unmarshaling notification: %w", err): + case errCh <- fmt.Errorf("error unmarshalling notification: %w", err): default: } return diff --git a/pkg/liveshare/session_test.go b/pkg/liveshare/session_test.go index 9de50ff92..ab7cf18bd 100644 --- a/pkg/liveshare/session_test.go +++ b/pkg/liveshare/session_test.go @@ -51,7 +51,7 @@ func TestServerStartSharing(t *testing.T) { startSharing := func(conn *jsonrpc2.Conn, req *jsonrpc2.Request) (interface{}, error) { var args []interface{} if err := json.Unmarshal(*req.Params, &args); err != nil { - return nil, fmt.Errorf("error unmarshaling request: %w", err) + return nil, fmt.Errorf("error unmarshalling request: %w", err) } if len(args) < 3 { return nil, errors.New("not enough arguments to start sharing") diff --git a/pkg/markdown/markdown.go b/pkg/markdown/markdown.go index 5466bcdd5..1aab0bcd3 100644 --- a/pkg/markdown/markdown.go +++ b/pkg/markdown/markdown.go @@ -10,7 +10,7 @@ func WithoutIndentation() glamour.TermRendererOption { } // WithoutWrap is a rendering option that set the character limit for soft -// wraping the markdown rendering. There is a max limit of 120 characters. +// wrapping the markdown rendering. There is a max limit of 120 characters. // If 0 is passed then wrapping is disabled. func WithWrap(w int) glamour.TermRendererOption { if w > 120 { diff --git a/utils/table_printer.go b/utils/table_printer.go index 3ccf93484..1bf9a955b 100644 --- a/utils/table_printer.go +++ b/utils/table_printer.go @@ -63,7 +63,7 @@ func (p printer) IsTTY() bool { func (p *printer) AddField(s string, truncateFunc func(int, string) string, colorFunc func(string) string) { if truncateFunc == nil { - // Disallow ever truncating the 1st colum or any URL value + // Disallow ever truncating the 1st column or any URL value if p.colIndex == 0 || isURL(s) { p.tp.AddField(s, tableprinter.WithTruncate(nil), tableprinter.WithColor(colorFunc)) } else {