Skip to content

Commit 5b4732f

Browse files
committed
chore(ci): add cspell spellcheck linting
I type a little too fast sometimes and make a lot of mistakes. Add cspell to make fewer of them.
1 parent d58f826 commit 5b4732f

17 files changed

Lines changed: 77 additions & 66 deletions

.cspell.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"version": "0.2",
3+
"language": "en",
4+
"dictionaries": [
5+
"go",
6+
"softwareTerms"
7+
],
8+
"words": [
9+
"cmder",
10+
"getopt",
11+
"untar",
12+
"hexdump"
13+
]
14+
}

.github/workflows/go.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,25 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v5
15+
with:
16+
persist-credentials: false
1517
- name: Set up Go
1618
uses: actions/setup-go@v4
1719
with:
1820
go-version: stable
1921
- name: Test
2022
run: make test
21-
- name: golangci-lint
23+
- name: Lint
2224
uses: golangci/golangci-lint-action@v9
2325
with:
2426
version: v2.9
27+
- name: Spelling
28+
uses: streetsidesoftware/cspell-action@v8
29+
continue-on-error: true
30+
with:
31+
files: |
32+
**/*.go
33+
README.md
34+
incremental_files_only: false
35+
suggestions: true

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ less is better. The wide range of examples throughout the project should help
1616
you get started.
1717

1818
To define a new command, simply define a type that implements the `Command`
19-
interface. If you want your command to have additional behaviour like flags or
19+
interface. If you want your command to have additional behavior like flags or
2020
subcommands, simply implement the appropriate interfaces.
2121

2222
Here are some highlights:
2323

24-
- Bring your own types. `cmder` doens't force you to use special `command`
24+
- Bring your own types. `cmder` doesn't force you to use special `command`
2525
structs. As long as you implement our narrow interfaces, you're good to go!
26-
- `cmder` is unobtrustive. Define your command and execute it. Simplicity above
26+
- `cmder` is unobtrusive. Define your command and execute it. Simplicity above
2727
all else!
2828
- `cmder` is totally stateless making it super easy to unit test your commands.
2929
This isn't the case in other libraries.
@@ -88,7 +88,7 @@ func main() {
8888
For more complex commands, you can define your own command type. By embedding
8989
`cmder.BaseCommand`, your command automatically implements all of the important
9090
interfaces needed to document your command, define flags, register subcommands,
91-
and so on. You can then override the default behaviour with your own.
91+
and so on. You can then override the default behavior with your own.
9292

9393
```go
9494
package main

command.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
// Command is the fundamental interface implemented by types that are runnable commands or subcommands. Commands can
99
// be executed with [Execute].
1010
//
11-
// Concrete types can implement additional interfaces to configure additional behaviour, like setup/teardown routines,
12-
// subcommands, command-line flags, and other behaviour:
11+
// Concrete types can implement additional interfaces to configure additional behavior, like setup/teardown routines,
12+
// subcommands, command-line flags, and other behavior:
1313
//
1414
// - If you want to configure setup and teardown routines for a command, see [Initializer] and [Destroyer].
1515
// - If your command has subcommands, see [RootCommand].
@@ -79,7 +79,7 @@ type Documented interface {
7979
//
8080
// Here are a few examples:
8181
//
82-
// git add [<options>] [--] <pathspec>...
82+
// git add [<options>] [--] <path spec>...
8383
// kubectl get [(-o|--output=)json|yaml|wide] (TYPE[.VERSION][.GROUP] [NAME | -l label] | TYPE[.VERSION][.GROUP]/NAME ...) [flags] [options]
8484
// crane index filter [flags]
8585
UsageLine() string
@@ -95,7 +95,7 @@ type Documented interface {
9595
ShortHelpText() string
9696

9797
// HelpText returns longer usage and help information for your users about this subcommand. Here you can describe
98-
// the behaviour of your command, summarize usage of certain flags and arguments and provide hints on where to find
98+
// the behavior of your command, summarize usage of certain flags and arguments and provide hints on where to find
9999
// additional information. This is akin to the "DESCRIPTION" section you would typically find in a man page.
100100
//
101101
// For a better viewing experience in terminals, consider maintaining consistent line length limits (120 is a good
@@ -124,7 +124,7 @@ var (
124124
_ HiddenCommand = &CommandDocumentation{}
125125
)
126126

127-
// CommandDocumentation implements [Documented] and can be embdded in command types to reduce boilerplate.
127+
// CommandDocumentation implements [Documented] and can be embedded in command types to reduce boilerplate.
128128
type CommandDocumentation struct {
129129
// The usage line. See UsageLine() in [Documented].
130130
Usage string

doc.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ commands, but that's about it. cmder embraces simplicity because sometimes, less
55
throughout the project should help you get started.
66
77
To define a new command, simply define a type that implements the [Command] interface. If you want your command to have
8-
additional behaviour like flags or subcommands, simply implement the appropriate interfaces.
8+
additional behavior like flags or subcommands, simply implement the appropriate interfaces.
99
10-
- Bring your own types. cmder doens't force you to use special command structs. As long as you implement our narrow
10+
- Bring your own types. cmder doesn't force you to use special command structs. As long as you implement our narrow
1111
interfaces, you're good to go!
12-
- cmder is unobtrustive. Define your command and execute it. Simplicity above all else!
12+
- cmder is unobtrusive. Define your command and execute it. Simplicity above all else!
1313
- cmder is totally stateless making it super easy to unit test your commands. This isn't the case in other libraries.
1414
- We take great pride in our documentation. If you find anything unclear, please let us know so we can fix it.
1515

example_basecommand_embed_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type implements all required interfaces needed to fulfill [cmder.Command]. You c
3030
your own implementation.
3131
3232
Example 'semver' manipulates a version string, bumping it up a major/minor/patch version or attaches build/pre-release
33-
information. By default, input versoins are bumped up a patch version.
33+
information. By default, input versions are bumped up a patch version.
3434
`
3535

3636
const SemverExamples = `

example_basecommand_simple_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,23 @@ func run(ctx context.Context, args []string) error {
8686
var out io.Writer = os.Stdout
8787

8888
if args[0] != "-" {
89-
inputf, err := os.Open(args[0])
89+
inputFile, err := os.Open(args[0])
9090
if err != nil {
9191
return err
9292
}
9393

94-
defer inputf.Close()
95-
in = inputf
94+
defer inputFile.Close()
95+
in = inputFile
9696
}
9797

9898
if output != "-" {
99-
outputf, err := os.Create(output)
99+
outputFile, err := os.Create(output)
100100
if err != nil {
101101
return err
102102
}
103103

104-
defer outputf.Close()
105-
out = outputf
104+
defer outputFile.Close()
105+
out = outputFile
106106
}
107107

108108
if hexdump {

example_comand_config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const MultiConfSettings = `{
4646
`
4747

4848
const MultiConfDesc = `
49-
'multi-conf' desmonstrates how you can setup configuration from a configuration file (json), environment variables, and
49+
'multi-conf' demonstrates how you can setup configuration from a configuration file (json), environment variables, and
5050
command-line flags. In this example, configuration is evaluated in this order, from lowest to highest precedence:
5151
5252
1. Configuration File (/etc/multi.conf)

example_exec_option_bind_env_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
func ExampleWithEnvironmentBinding() {
13-
os.Setenv("BINDENV_SHOW_FORMAT", "overidden-by-flag")
13+
os.Setenv("BINDENV_SHOW_FORMAT", "overridden-by-flag")
1414
os.Setenv("BINDENV_SHOW_PAGECOUNT", "20")
1515

1616
args := []string{"show", "--format=pretty"}

example_exec_option_interspersed_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func ExampleWithInterspersedArgs() {
2828
}
2929

3030
const HashDesc = `
31-
'hash' desmonstrates how cmder can be configured to parse args with interspersed args and flags. The command generates
31+
'hash' demonstrates how cmder can be configured to parse args with interspersed args and flags. The command generates
3232
and prints a hash of the concatenated command args.
3333
`
3434

0 commit comments

Comments
 (0)