Skip to content

Commit

Permalink
ci: Configure crate-ci/typos and auto fix what I can (#1551)
Browse files Browse the repository at this point in the history
* ci: Configure crate-ci/typos and auto fix what I can

* Add typos/spellcheck to contributing docs
  • Loading branch information
halkeye committed Jul 17, 2024
1 parent 7f92de4 commit 9128ab5
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ or `make help` for a list of available commands with descriptions.
- Avoid the passive voice ("When a tag is provided, access is granted") and use the active voice ("Entering a tag provides access")
- Be helpful when users have to enter a input that is from a list of possible values. Give examples, list the possible values inline (if the list is relatively short), or point them to a command that can list the possible values for them.

## Spell Check

`doctl` is setup to use the code aware spell checker called [typos](https://github.com/crate-ci/typos) to keep an eye on any spelling mistakes.

To install your own copy,follow the instructions on the [typos readme](https://github.com/crate-ci/typos?tab=readme-ov-file#install), and then run the `typos` binary

### Go environment

Expand Down
16 changes: 16 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[files]
extend-exclude = [
"vendor/**",
"go.mod"
]

[default.extend-identifiers]
vas = "vas"
splitted = "splitted"

[default.extend-words]
# Its not perfect at hashes yet
cace = "cace"
Wqs = "Wqs"
# example and exmaple as two domain examples
exmaple = "exmaple"
4 changes: 2 additions & 2 deletions args.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ const (
ArgDatabaseTopicMaxCompactionLagMS = "max-compaction-lag-ms"
// ArgDatabaseTopicMaxMessageBytes is the maximum size, in bytes, of the largest record batch that can be sent to the server
ArgDatabaseTopicMaxMessageBytes = "max-message-bytes"
// ArgDatabaseTopicMesssageDownConversionEnable determines whether brokers should convert messages for consumers expecting older message formats
ArgDatabaseTopicMesssageDownConversionEnable = "message-down-conversion-enable"
// ArgDatabaseTopicMessageDownConversionEnable determines whether brokers should convert messages for consumers expecting older message formats
ArgDatabaseTopicMessageDownConversionEnable = "message-down-conversion-enable"
// ArgDatabaseTopicMessageFormatVersion is the version used by the broker to append messages to the kafka topic logs
ArgDatabaseTopicMessageFormatVersion = "message-format-version"
// ArgDatabaseTopicMessageTimestampType is the timestamp used for messages
Expand Down
2 changes: 1 addition & 1 deletion commands/command_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (c *CmdConfig) Display(d displayers.Displayable) error {
return dc.Display()
}

// An urner implements the URN method, wihich returns a valid uniform resource
// An urner implements the URN method, which returns a valid uniform resource
// name.
type urner interface {
URN() string
Expand Down
4 changes: 2 additions & 2 deletions commands/databases.go
Original file line number Diff line number Diff line change
Expand Up @@ -1791,7 +1791,7 @@ func getDatabaseTopicConfigArgs(c *CmdConfig) *godo.TopicConfig {
res.MaxMessageBytes = &i
}
}
bVal, err := c.Doit.GetBoolPtr(c.NS, doctl.ArgDatabaseTopicMesssageDownConversionEnable)
bVal, err := c.Doit.GetBoolPtr(c.NS, doctl.ArgDatabaseTopicMessageDownConversionEnable)
if err == nil && bVal != nil {
res.MessageDownConversionEnable = bVal
}
Expand Down Expand Up @@ -1936,7 +1936,7 @@ This command lists the following details for each partition of a given topic in
"Specifies the maximum time (in ms) that a message will remain uncompacted. This is only applicable if the logs have compaction enabled")
AddStringFlag(c, doctl.ArgDatabaseTopicMaxMessageBytes, "", "",
"Specifies the largest record batch (in bytes) that can be sent to the server. This is calculated after compression, if compression is enabled")
AddBoolFlag(c, doctl.ArgDatabaseTopicMesssageDownConversionEnable, "", true,
AddBoolFlag(c, doctl.ArgDatabaseTopicMessageDownConversionEnable, "", true,
"Specifies whether down-conversion of message formats is enabled to satisfy consumer requests")
AddStringFlag(c, doctl.ArgDatabaseTopicMessageFormatVersion, "", "",
"Specifies the message format version used by the broker to append messages to the logs. By setting a format version, all existing messages on disk must be smaller or equal to the specified version")
Expand Down
3 changes: 2 additions & 1 deletion commands/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ import (
"strings"

"github.com/apache/openwhisk-client-go/whisk"
"github.com/spf13/cobra"

"github.com/digitalocean/doctl"
"github.com/digitalocean/doctl/commands/charm/template"
"github.com/digitalocean/doctl/commands/displayers"
"github.com/digitalocean/doctl/do"
"github.com/spf13/cobra"
)

// Functions generates the serverless 'functions' subtree for addition to the doctl command
Expand Down
2 changes: 1 addition & 1 deletion commands/serverless_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ func TestServerlessInit(t *testing.T) {
}

sawOverwrite := false
// Grab the overrideable commands so they can be mocked
// Grab the overridable commands so they can be mocked
writeAFile = func(path string, contents []byte) error {
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion do/serverless.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type OutputNamespace struct {
}

// FunctionParameter is the type of a parameter in the response body of action.get. We do our
// own JSON unmarshaling of these because the go OpenWhisk client doesn't include the "init" and
// own JSON unmarshalling of these because the go OpenWhisk client doesn't include the "init" and
// "encryption" members, of which at least "init" is needed.
type FunctionParameter struct {
Key string `json:"key"`
Expand Down
2 changes: 1 addition & 1 deletion integration/droplet_neighbors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ var _ = suite("compute/droplet/neighbors", func(t *testing.T, when spec.G, it sp
})

when("asking for particular headers", func() {
it("only lists thoses headers", func() {
it("only lists those headers", func() {
cmd := exec.Command(builtBinaryPath,
"compute",
"droplet",
Expand Down
2 changes: 1 addition & 1 deletion scripts/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Options:
-i, --image snap image version
-b, --branch branch only
-c, --commit commit only
--snap, returns the version formated for a snap release
--snap, returns the version formatted for a snap release
"

semver() {
Expand Down

0 comments on commit 9128ab5

Please sign in to comment.