From 83b17d41aadb03fa7da98d2f9c42d2e715d92000 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Sun, 27 Oct 2024 10:05:11 +0900 Subject: [PATCH] docs: fix typo using typos ```sh typos -w ``` --- _typos.toml | 6 ++++++ command_test.go | 10 +++++----- docs/CHANGELOG.md | 2 +- flag_test.go | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 _typos.toml diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 0000000000..17e2e1f486 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,6 @@ +# https://github.com/crate-ci/typos +[default.extend-words] +som = "som" +halp = "halp" +pn = "pn" +ser = "ser" diff --git a/command_test.go b/command_test.go index c64b624132..b8ba1eb658 100644 --- a/command_test.go +++ b/command_test.go @@ -3121,35 +3121,35 @@ func TestShorthandCommand(t *testing.T) { err := cmd.Run(buildTestContext(t), []string{"foo", "cth"}) assert.NoError(t, err) - assert.True(t, cmd1 == 1 && cmd2 == 0, "Expected command1 to be trigerred once") + assert.True(t, cmd1 == 1 && cmd2 == 0, "Expected command1 to be triggered once") cmd1 = 0 cmd2 = 0 err = cmd.Run(buildTestContext(t), []string{"foo", "cthd"}) assert.NoError(t, err) - assert.True(t, cmd1 == 1 && cmd2 == 0, "Expected command1 to be trigerred once") + assert.True(t, cmd1 == 1 && cmd2 == 0, "Expected command1 to be triggered once") cmd1 = 0 cmd2 = 0 err = cmd.Run(buildTestContext(t), []string{"foo", "cthe"}) assert.NoError(t, err) - assert.True(t, cmd1 == 1 && cmd2 == 0, "Expected command1 to be trigerred once") + assert.True(t, cmd1 == 1 && cmd2 == 0, "Expected command1 to be triggered once") cmd1 = 0 cmd2 = 0 err = cmd.Run(buildTestContext(t), []string{"foo", "cthert"}) assert.NoError(t, err) - assert.True(t, cmd1 == 0 && cmd2 == 1, "Expected command1 to be trigerred once") + assert.True(t, cmd1 == 0 && cmd2 == 1, "Expected command1 to be triggered once") cmd1 = 0 cmd2 = 0 err = cmd.Run(buildTestContext(t), []string{"foo", "cthet"}) assert.NoError(t, err) - assert.True(t, cmd1 == 0 && cmd2 == 1, "Expected command1 to be trigerred once") + assert.True(t, cmd1 == 0 && cmd2 == 1, "Expected command1 to be triggered once") } func TestCommand_Int(t *testing.T) { diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index d096f57e41..e373c75b75 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -71,7 +71,7 @@ The V2 changes were all shipped in [urfave/cli/pull/892](https://github.com/urfa ### Added - Added `NewStringSlice` and `NewIntSlice` for creating their related types -- Added `Float64SliceFlag` for unmarshaling a list of floats from the user +- Added `Float64SliceFlag` for unmarshalling a list of floats from the user - Added `Context.Lineage` to get all contexts from current up to global - Added `Context.LocalFlagNames` to get the flag names from *only* the current context - Added `BoolFlag.Value` to handle both default-false and default-true diff --git a/flag_test.go b/flag_test.go index 87146d5f55..40f4fb1264 100644 --- a/flag_test.go +++ b/flag_test.go @@ -3100,7 +3100,7 @@ func TestNonStringMap(t *testing.T) { assert.ErrorContains(t, f.Set("invalid=value"), "ParseFloat") } -func TestUnqouteUsage(t *testing.T) { +func TestUnquoteUsage(t *testing.T) { tests := []struct { str string expStr string