Skip to content

Commit

Permalink
Merge pull request #7342 from goggle/typos01
Browse files Browse the repository at this point in the history
Correct some typos
  • Loading branch information
mislav committed Apr 21, 2023
2 parents 09e86d0 + 218f29f commit 8b2cea1
Show file tree
Hide file tree
Showing 20 changed files with 37 additions and 37 deletions.
4 changes: 2 additions & 2 deletions api/sanitize_ascii.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions git/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
28 changes: 14 additions & 14 deletions internal/codespaces/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"))
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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 != "" {
Expand All @@ -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
Expand Down Expand Up @@ -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"))
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions internal/codespaces/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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(`<http://%[1]s/user/codespaces?page=3&per_page=%[2]d>; rel="last", <http://%[1]s/user/codespaces?page=2&per_page=%[2]d>; rel="next"`, r.Host, per_page))
case 2:
response.Codespaces = generateCodespaceList(per_page, per_page*2)
Expand Down
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/browse/browse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/codespace/ports.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/codespace/ports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/extension/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/pr/merge/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/pr/shared/editable_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/repo/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/repo/delete/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/run/view/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/liveshare/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion pkg/liveshare/ports.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (s *Session) WaitForPortNotification(ctx context.Context, port int, notifTy
notification := new(PortNotification)
if err := json.Unmarshal(*req.Params, &notification); err != nil {
select {
case errCh <- fmt.Errorf("error unmarshaling notification: %w", err):
case errCh <- fmt.Errorf("error unmarshalling notification: %w", err):
default:
}
return
Expand Down
2 changes: 1 addition & 1 deletion pkg/liveshare/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion pkg/markdown/markdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion utils/table_printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8b2cea1

Please sign in to comment.