Skip to content

Commit

Permalink
Grammar and typo fixes in comments and tests (#1046)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed Oct 27, 2021
1 parent 0789bfa commit a53a557
Show file tree
Hide file tree
Showing 31 changed files with 52 additions and 52 deletions.
14 changes: 7 additions & 7 deletions args.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const (
ArgHA = "ha"
// ArgSurgeUpgrade is a cluster's surge-upgrade argument.
ArgSurgeUpgrade = "surge-upgrade"
// ArgCommandUpsert is a upsert for a resource to be created or updated argument.
// ArgCommandUpsert is an upsert for a resource to be created or updated argument.
ArgCommandUpsert = "upsert"
// ArgCommandWait is a wait for a resource to be created argument.
ArgCommandWait = "wait"
Expand All @@ -92,7 +92,7 @@ const (
ArgDropletID = "droplet-id"
// ArgDropletIDs is a list of droplet IDs.
ArgDropletIDs = "droplet-ids"
// ArgKernelID is a ekrnel id argument.
// ArgKernelID is a kernel id argument.
ArgKernelID = "kernel-id"
// ArgKubernetesLabel is a Kubernetes label argument.
ArgKubernetesLabel = "label"
Expand All @@ -106,7 +106,7 @@ const (
ArgImageID = "image-id"
// ArgImagePublic is a public image argument.
ArgImagePublic = "public"
// ArgImageSlug is an image slug argment.
// ArgImageSlug is an image slug argument.
ArgImageSlug = "image-slug"
// ArgIPAddress is an IP address argument.
ArgIPAddress = "ip-address"
Expand All @@ -128,7 +128,7 @@ const (
ArgPrivateNetworking = "enable-private-networking"
// ArgMonitoring is an enable monitoring argument.
ArgMonitoring = "enable-monitoring"
// ArgDropletAgent is an argument for enabling/disbling the Droplet agent.
// ArgDropletAgent is an argument for enabling/disabling the Droplet agent.
ArgDropletAgent = "droplet-agent"
// ArgRecordData is a record data argument.
ArgRecordData = "record-data"
Expand Down Expand Up @@ -192,7 +192,7 @@ const (
ArgKeyPublicKeyFile = "public-key-file"
// ArgSSHUser is a SSH user argument.
ArgSSHUser = "ssh-user"
// ArgFormat is columns to include in output argment.
// ArgFormat is columns to include in output argument.
ArgFormat = "format"
// ArgNoHeader hides the output header.
ArgNoHeader = "no-header"
Expand Down Expand Up @@ -396,9 +396,9 @@ const (
// ArgAlertPolicyEmails are the emails to send alerts to.
ArgAlertPolicyEmails = "emails"

// ArgAlertPolicySlackChannels are the slack channels to send alerts to.
// ArgAlertPolicySlackChannels are the Slack channels to send alerts to.
ArgAlertPolicySlackChannels = "slack-channels"

// ArgAlertPolicySlackURLs are the slack URLs to send alerts to.
// ArgAlertPolicySlackURLs are the Slack URLs to send alerts to.
ArgAlertPolicySlackURLs = "slack-urls"
)
2 changes: 1 addition & 1 deletion commands/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func Test_displayAuthContexts(t *testing.T) {
Expected: "default (current)\ntest\n",
},
{
Name: "default context and additional context set to addditional context",
Name: "default context and additional context set to additional context",
Out: &bytes.Buffer{},
Context: "test",
Contexts: map[string]interface{}{
Expand Down
4 changes: 2 additions & 2 deletions commands/certificates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestCertificatesCreate(t *testing.T) {
},

{
desc: "creates custom cerftificate without specifying chain",
desc: "creates custom certificate without specifying chain",
certName: "cert-without-chain",
privateKeyPath: filepath.Join(os.TempDir(), "cer-key.crt"),
certLeafPath: filepath.Join(os.TempDir(), "leaf-cer.crt"),
Expand All @@ -90,7 +90,7 @@ func TestCertificatesCreate(t *testing.T) {
},
},
{
desc: "creates lets_encrypt cerftificate",
desc: "creates lets_encrypt certificate",
certName: "lets-encrypt-cert",
DNSNames: []string{"sampledomain.org", "api.sampledomain.org"},
certType: "lets_encrypt",
Expand Down
2 changes: 1 addition & 1 deletion commands/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ func RunCompletionZsh(c *CmdConfig) error {
// zshHead is the header required to declare zsh completion
zshHead := "#compdef doctl\n"

// zshInit represents intialization code needed to convert bash completion
// zshInit represents initialization code needed to convert bash completion
// code to zsh completion.
zshInit := `
__doctl_bash_source() {
Expand Down
2 changes: 1 addition & 1 deletion commands/confirmation.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func AskForConfirm(message string) error {
return nil
}

// AskForConfirmDelete builds a message to ask the user to confirm deleteing
// AskForConfirmDelete builds a message to ask the user to confirm deleting
// one or multiple resources and then sends it through to AskForConfirm to
// parses and verifies user input.
func AskForConfirmDelete(resourceType string, count int) error {
Expand Down
2 changes: 1 addition & 1 deletion commands/displayers/1_click.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (oc *OneClick) JSON(out io.Writer) error {
return writeJSON(oc.OneClicks, out)
}

// Cols are the colums returned in the json
// Cols are the columns returned in the json
func (oc *OneClick) Cols() []string {
return []string{
"SLUG",
Expand Down
2 changes: 1 addition & 1 deletion commands/displayers/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"text/tabwriter"
)

// Displayable is a displable entity. These are used for printing results.
// Displayable is a displayable entity. These are used for printing results.
type Displayable interface {
Cols() []string
ColMap() map[string]string
Expand Down
2 changes: 1 addition & 1 deletion commands/droplet_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ func RunDropletActionRestore(c *CmdConfig) error {
return performAction(c, fn)
}

// RunDropletActionResize resizesx a droplet giving a size slug and
// RunDropletActionResize resizes a droplet giving a size slug and
// optionally expands the disk.
func RunDropletActionResize(c *CmdConfig) error {
fn := func(das do.DropletActionsService) (*do.Action, error) {
Expand Down
2 changes: 1 addition & 1 deletion commands/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func RunImagesListDistribution(c *CmdConfig) error {

}

// RunImagesListApplication lists application iamges.
// RunImagesListApplication lists application images.
func RunImagesListApplication(c *CmdConfig) error {
is := c.Images()

Expand Down
6 changes: 3 additions & 3 deletions commands/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (p *kubeconfigProvider) Local() (*clientcmdapi.Config, error) {
for _, err := range a.Errors() {
// this should NOT be a contains check but they are formatting the
// error without implementing an unwrap (so the original permission
// error type is lost.
// error type is lost).
if strings.Contains(err.Error(), "permission denied") && isSnap {
warn("Using the doctl Snap? Grant access to the doctl:kube-config plug to use this command with: sudo snap connect doctl:kube-config")
return nil, err
Expand Down Expand Up @@ -1691,7 +1691,7 @@ func buildNodePoolRecycleRequestFromArgs(c *CmdConfig, clusterID, poolID string,
if allUUIDs {
r.Nodes = nodeIDorNames
} else {
// at least some of the args weren't UUIDs, so assume that they're all names
// at least some args weren't UUIDs, so assume that they're all names
nodes, err := nodesByNames(c.Kubernetes(), clusterID, poolID, nodeIDorNames)
if err != nil {
return err
Expand Down Expand Up @@ -2414,7 +2414,7 @@ func versionMaxBy(versions []do.KubernetesVersion, selector func(do.KubernetesVe
if err != nil {
return max, err
}
// NOTE: We have to iterate over all of versions here even though we know
// NOTE: We have to iterate over all versions here even though we know
// versions[0] won't be greater than maxSV so that the index i will be a
// valid index into versions rather than into versions[1:].
for i, v := range versions {
Expand Down
6 changes: 3 additions & 3 deletions commands/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ func TestKubernetesUpgrade(t *testing.T) {

func TestKubernetesDelete(t *testing.T) {
withTestClient(t, func(config *CmdConfig, tm *tcMocks) {
// should'nt call `DeleteNodePool` so we don't set any expectations
// shouldn't call `DeleteNodePool` so we don't set any expectations
config.Doit.Set(config.NS, doctl.ArgForce, "false")
config.Args = append(config.Args, testCluster.ID)

Expand Down Expand Up @@ -710,7 +710,7 @@ func TestKubernetesDelete(t *testing.T) {

func TestKubernetesDeleteSelective(t *testing.T) {
withTestClient(t, func(config *CmdConfig, tm *tcMocks) {
// should'nt call `DeleteNodePool` so we don't set any expectations
// shouldn't call `DeleteNodePool` so we don't set any expectations
config.Doit.Set(config.NS, doctl.ArgForce, "false")
config.Args = append(config.Args, testCluster.ID)

Expand Down Expand Up @@ -1180,7 +1180,7 @@ func TestKubernetesNodePool_Recycle(t *testing.T) {

func TestKubernetesNodePool_Delete(t *testing.T) {
withTestClient(t, func(config *CmdConfig, tm *tcMocks) {
// should'nt call `DeleteNodePool` so we don't set any expectations
// shouldn't call `DeleteNodePool` so we don't set any expectations
config.Doit.Set(config.NS, doctl.ArgForce, "false")
config.Args = append(config.Args, testCluster.ID, testNodePool.ID)

Expand Down
2 changes: 1 addition & 1 deletion do/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/stretchr/testify/assert"
)

// MockAccountService is a mock of AccountService interface
// MockAccountService is a mock for AccountService interface
type MockAccountService struct {
ctrl *gomock.Controller
recorder *MockAccountServiceMockRecorder
Expand Down
2 changes: 1 addition & 1 deletion do/balance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/stretchr/testify/assert"
)

// MockBalanceService is a mock of BalanceService interface
// MockBalanceService is a mock for BalanceService interface
type MockBalanceService struct {
ctrl *gomock.Controller
recorder *MockBalanceServiceMockRecorder
Expand Down
2 changes: 1 addition & 1 deletion do/domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type DomainRecordEditRequest struct {
// DomainRecords is a slice of DomainRecord.
type DomainRecords []DomainRecord

// DomainsService is the godo DOmainsService interface.
// DomainsService is the godo DomainsService interface.
type DomainsService interface {
List() (Domains, error)
Get(string) (*Domain, error)
Expand Down
2 changes: 1 addition & 1 deletion do/droplets.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
// DropletIPTable is a table of interface IPS.
type DropletIPTable map[InterfaceType]string

// InterfaceType is a an interface type.
// InterfaceType is an interface type.
type InterfaceType string

const (
Expand Down
2 changes: 1 addition & 1 deletion do/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/digitalocean/godo"
)

// Image is a werapper for godo.Image
// Image is a wrapper for godo.Image
type Image struct {
*godo.Image
}
Expand Down
2 changes: 1 addition & 1 deletion do/invoices.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type InvoiceSummary struct {
*godo.InvoiceSummary
}

// InvoiceList is a the results when listing invoices
// InvoiceList is the results when listing invoices
type InvoiceList struct {
*godo.InvoiceList
}
Expand Down
2 changes: 1 addition & 1 deletion doit.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ type LatestVersioner interface {
LatestVersion() (string, error)
}

// GithubLatestVersioner retrieves the latest version from Github.
// GithubLatestVersioner retrieves the latest version from GitHub.
type GithubLatestVersioner struct{}

var _ LatestVersioner = &GithubLatestVersioner{}
Expand Down
4 changes: 2 additions & 2 deletions integration/domain_records_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ var _ = suite("compute/domain/records/delete", func(t *testing.T, when spec.G, i
})

when("deleting one domain record without force flag", func() {
it("correctly promts for confirmation", func() {
it("correctly prompts for confirmation", func() {
cmd := exec.Command(builtBinaryPath,
"-t", "some-magic-token",
"-u", server.URL,
Expand All @@ -133,7 +133,7 @@ var _ = suite("compute/domain/records/delete", func(t *testing.T, when spec.G, i
})

when("deleting two domain records without force flag", func() {
it("correctly promts for confirmation", func() {
it("correctly prompts for confirmation", func() {
cmd := exec.Command(builtBinaryPath,
"-t", "some-magic-token",
"-u", server.URL,
Expand Down
8 changes: 4 additions & 4 deletions integration/droplet_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ var _ = suite("compute/droplet/delete", func(t *testing.T, when spec.G, it spec.
})

when("deleting one Droplet without force flag", func() {
it("correctly promts for confirmation", func() {
it("correctly prompts for confirmation", func() {
cmd := exec.Command(builtBinaryPath,
"-t", "some-magic-token",
"-u", server.URL,
Expand All @@ -153,7 +153,7 @@ var _ = suite("compute/droplet/delete", func(t *testing.T, when spec.G, it spec.
})

when("deleting two Droplet without force flag", func() {
it("correctly promts for confirmation", func() {
it("correctly prompts for confirmation", func() {
cmd := exec.Command(builtBinaryPath,
"-t", "some-magic-token",
"-u", server.URL,
Expand All @@ -171,7 +171,7 @@ var _ = suite("compute/droplet/delete", func(t *testing.T, when spec.G, it spec.
})

when("deleting one Droplet by tag without force flag", func() {
it("correctly promts for confirmation", func() {
it("correctly prompts for confirmation", func() {
cmd := exec.Command(builtBinaryPath,
"-t", "some-magic-token",
"-u", server.URL,
Expand All @@ -188,7 +188,7 @@ var _ = suite("compute/droplet/delete", func(t *testing.T, when spec.G, it spec.
})

when("deleting two Droplet by tag without force flag", func() {
it("correctly promts for confirmation", func() {
it("correctly prompts for confirmation", func() {
cmd := exec.Command(builtBinaryPath,
"-t", "some-magic-token",
"-u", server.URL,
Expand Down
4 changes: 2 additions & 2 deletions integration/firewall_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var _ = suite("compute/firewall/delete", func(t *testing.T, when spec.G, it spec
})

when("deleting one firewall without force flag", func() {
it("correctly promts for confirmation", func() {
it("correctly prompts for confirmation", func() {
cmd := exec.Command(builtBinaryPath,
"-t", "some-magic-token",
"-u", server.URL,
Expand All @@ -115,7 +115,7 @@ var _ = suite("compute/firewall/delete", func(t *testing.T, when spec.G, it spec
})

when("deleting two firewalls without force flag", func() {
it("correctly promts for confirmation", func() {
it("correctly prompts for confirmation", func() {
cmd := exec.Command(builtBinaryPath,
"-t", "some-magic-token",
"-u", server.URL,
Expand Down
4 changes: 2 additions & 2 deletions integration/image_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var _ = suite("compute/image/delete", func(t *testing.T, when spec.G, it spec.S)
})

when("deleting one image without force flag", func() {
it("correctly promts for confirmation", func() {
it("correctly prompts for confirmation", func() {
cmd := exec.Command(builtBinaryPath,
"-t", "some-magic-token",
"-u", server.URL,
Expand All @@ -115,7 +115,7 @@ var _ = suite("compute/image/delete", func(t *testing.T, when spec.G, it spec.S)
})

when("deleting two images without force flag", func() {
it("correctly promts for confirmation", func() {
it("correctly prompts for confirmation", func() {
cmd := exec.Command(builtBinaryPath,
"-t", "some-magic-token",
"-u", server.URL,
Expand Down
2 changes: 1 addition & 1 deletion integration/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestMain(m *testing.M) {
if err != nil {
panic("failed to create temp dir")
}
defer os.RemoveAll(tmpDir) // yes, this is best effort only
defer os.RemoveAll(tmpDir) // yes, this is the best effort only

builtBinaryPath = filepath.Join(tmpDir, path.Base(packagePath))
if runtime.GOOS == "windows" {
Expand Down
2 changes: 1 addition & 1 deletion integration/projects_resources_assign_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var _ = suite("projects/resources/assign", func(t *testing.T, when spec.G, it sp
})

when("all required flags are passed", func() {
it("assigns resources to the proejct", func() {
it("assigns resources to the project", func() {
cmd := exec.Command(builtBinaryPath,
"-t", "some-magic-token",
"-u", server.URL,
Expand Down
2 changes: 1 addition & 1 deletion integration/projects_resources_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var _ = suite("projects/resources/list", func(t *testing.T, when spec.G, it spec
})

when("all required flags are passed", func() {
it("list resources for the proejct", func() {
it("list resources for the project", func() {
cmd := exec.Command(builtBinaryPath,
"-t", "some-magic-token",
"-u", server.URL,
Expand Down
2 changes: 1 addition & 1 deletion integration/registry_docker_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ var _ = suite("registry/docker-config", func(t *testing.T, when spec.G, it spec.
})

when("expiry-seconds flag is passed", func() {
it("add the correct query paramater", func() {
it("add the correct query parameter", func() {
cmd := exec.Command(builtBinaryPath,
"-t", "some-magic-token",
"-u", server.URL,
Expand Down
2 changes: 1 addition & 1 deletion integration/registry_login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ var _ = suite("registry/login", func(t *testing.T, when spec.G, it spec.S) {
})

when("expiry-seconds flag is passed", func() {
it("add the correct query paramater", func() {
it("add the correct query parameter", func() {
tmpDir, err := ioutil.TempDir("", "")
expect.NoError(err)

Expand Down
Loading

0 comments on commit a53a557

Please sign in to comment.