Skip to content

Commit

Permalink
Make the spellchecker happy
Browse files Browse the repository at this point in the history
  • Loading branch information
tkw1536 committed May 4, 2024
1 parent 8716237 commit 9c93ae9
Show file tree
Hide file tree
Showing 99 changed files with 411 additions and 152 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ ggman comes with the following builtin aliases:
### 1.21.0 (Upcoming)

- Various internal performance tweaks
- make spellchecker happy
- Update to `go 1.22`
- Update to goprogram `0.5.0`
- Update dependencies
Expand Down
3 changes: 3 additions & 0 deletions cmd/canon.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package cmd

//spellchecker:words github ggman
import (
"github.com/tkw1536/ggman"
"github.com/tkw1536/ggman/env"
)

//spellchecker:words CANSPEC CANFILE

// Canon is the 'ggman canon' command.
//
// The 'ggman canon' command prints to standard output the canonical version of the URL passed as the first argument.
Expand Down
5 changes: 3 additions & 2 deletions cmd/canon_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cmd

//spellchecker:words testing github ggman internal mockenv
import (
"testing"

Expand All @@ -11,7 +12,7 @@ func TestCommandCanon(t *testing.T) {

tests := []struct {
name string
workdir string
workDir string
args []string

wantCode uint8
Expand Down Expand Up @@ -101,7 +102,7 @@ func TestCommandCanon(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
code, stdout, stderr := mock.Run(Canon, tt.workdir, "", tt.args...)
code, stdout, stderr := mock.Run(Canon, tt.workDir, "", tt.args...)
if code != tt.wantCode {
t.Errorf("Code = %d, wantCode = %d", code, tt.wantCode)
}
Expand Down
1 change: 1 addition & 0 deletions cmd/clone.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cmd

//spellchecker:words errors github ggman goprogram exit parser
import (
"errors"
"fmt"
Expand Down
7 changes: 5 additions & 2 deletions cmd/clone_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package cmd

//spellchecker:words testing github ggman internal mockenv
import (
"testing"

"github.com/tkw1536/ggman/internal/mockenv"
)

//spellchecker:words GGROOT

func TestCommandClone(t *testing.T) {
mock := mockenv.NewMockEnv(t)

Expand All @@ -14,7 +17,7 @@ func TestCommandClone(t *testing.T) {

tests := []struct {
name string
workdir string
workDir string
args []string

wantCode uint8
Expand Down Expand Up @@ -111,7 +114,7 @@ func TestCommandClone(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
code, stdout, stderr := mock.Run(Clone, tt.workdir, "", tt.args...)
code, stdout, stderr := mock.Run(Clone, tt.workDir, "", tt.args...)
if code != tt.wantCode {
t.Errorf("Code = %d, wantCode = %d", code, tt.wantCode)
}
Expand Down
1 change: 1 addition & 0 deletions cmd/comps.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cmd

//spellchecker:words github ggman
import (
"github.com/tkw1536/ggman"
"github.com/tkw1536/ggman/env"
Expand Down
3 changes: 3 additions & 0 deletions cmd/comps_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package cmd

//spellchecker:words testing github ggman internal mockenv
import (
"testing"

"github.com/tkw1536/ggman/internal/mockenv"
)

//spellchecker:words workdir

func TestCommandComps(t *testing.T) {
mock := mockenv.NewMockEnv(t)

Expand Down
1 change: 1 addition & 0 deletions cmd/env.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cmd

//spellchecker:words github alessio shellescape ggman goprogram exit pkglib collection
import (
"github.com/alessio/shellescape"
"github.com/tkw1536/ggman"
Expand Down
3 changes: 3 additions & 0 deletions cmd/env_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package cmd

//spellchecker:words testing github ggman internal mockenv
import (
"testing"

"github.com/tkw1536/ggman/internal/mockenv"
)

//spellchecker:words workdir GGROOT

func TestCommandEnv(t *testing.T) {
mock := mockenv.NewMockEnv(t)

Expand Down
7 changes: 5 additions & 2 deletions cmd/exec.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cmd

//spellchecker:words exec github alessio shellescape ggman goprogram exit parser pkglib sema status stream
import (
"os/exec"

Expand All @@ -13,6 +14,8 @@ import (
"github.com/tkw1536/pkglib/stream"
)

//spellchecker:words positionals compat

// Exec is the 'ggman exec' command.
//
// Exec executes an external command for every repository known to ggman.
Expand Down Expand Up @@ -75,14 +78,14 @@ func (exe) Description() ggman.Description {
}
}

var ErrExecParalllelNegative = exit.Error{
var ErrExecParallelNegative = exit.Error{
ExitCode: exit.ExitCommandArguments,
Message: "argument for `--parallel` must be non-negative",
}

func (e exe) AfterParse() error {
if e.Parallel < 0 {
return ErrExecParalllelNegative
return ErrExecParallelNegative
}
return nil
}
Expand Down
3 changes: 3 additions & 0 deletions cmd/exec_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cmd

//spellchecker:words exec runtime testing github ggman internal mockenv
import (
"os/exec"
"runtime"
Expand All @@ -8,6 +9,8 @@ import (
"github.com/tkw1536/ggman/internal/mockenv"
)

//spellchecker:words workdir GGROOT

func setupExecTest(t *testing.T) (mock *mockenv.MockEnv) {
mock = mockenv.NewMockEnv(t)

Expand Down
1 change: 1 addition & 0 deletions cmd/fetch.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cmd

//spellchecker:words github ggman goprogram exit
import (
"github.com/tkw1536/ggman"
"github.com/tkw1536/ggman/env"
Expand Down
3 changes: 3 additions & 0 deletions cmd/fetch_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cmd

//spellchecker:words testing github ggman internal mockenv testutil
import (
"fmt"
"testing"
Expand All @@ -8,6 +9,8 @@ import (
"github.com/tkw1536/ggman/internal/testutil"
)

//spellchecker:words workdir

func TestCommandFetch(t *testing.T) {
mock := mockenv.NewMockEnv(t)

Expand Down
3 changes: 3 additions & 0 deletions cmd/find_branch.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package cmd

//spellchecker:words github ggman goprogram exit
import (
"github.com/tkw1536/ggman"
"github.com/tkw1536/ggman/env"
"github.com/tkw1536/goprogram/exit"
)

//spellchecker:words positionals

// FindBranch is the 'ggman find-branch' command.
//
// The 'find-branch' command lists all repositories that contain a branch with the provided name.
Expand Down
3 changes: 3 additions & 0 deletions cmd/find_branch_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cmd

//spellchecker:words testing github config ggman internal mockenv
import (
"testing"

Expand All @@ -8,6 +9,8 @@ import (
"github.com/tkw1536/ggman/internal/mockenv"
)

//spellchecker:words GGROOT workdir

func TestCommandFindBranch(t *testing.T) {
mock := mockenv.NewMockEnv(t)

Expand Down
3 changes: 3 additions & 0 deletions cmd/fix.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cmd

//spellchecker:words sync github ggman goprogram exit
import (
"sync"

Expand All @@ -8,6 +9,8 @@ import (
"github.com/tkw1536/goprogram/exit"
)

//spellchecker:words canonicalizes canonicalization

// Fix is the 'ggman fix' command.
//
// The 'ggman fix' command canonicalizes the urls of all remotes of a repository.
Expand Down
3 changes: 3 additions & 0 deletions cmd/fix_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package cmd

//spellchecker:words testing github ggman internal mockenv
import (
"testing"

"github.com/tkw1536/ggman/internal/mockenv"
)

//spellchecker:words GGROOT workdir

func TestCommandFix(t *testing.T) {
mock := mockenv.NewMockEnv(t)

Expand Down
5 changes: 5 additions & 0 deletions cmd/ggman/ggman.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,11 @@
// When a subcommand succeeds, ggman exits with code 0.
// When something goes wrong, it instead exits with a non-zero exit code.
// Exit codes are defined by the ExitCode type in the github.com/tkw1536/ggman package.
//
//spellchecker:words main
package main

//spellchecker:words runtime debug github ggman goprogram exit pkglib stream
import (
"fmt"
"os"
Expand All @@ -113,6 +116,8 @@ import (
"github.com/tkw1536/pkglib/stream"
)

//spellchecker:words unsynced GGROOT GGNORM CANFILE shellrc workdir

// the main ggman program that will contain everything
var ggmanExe = ggman.NewProgram()

Expand Down
6 changes: 5 additions & 1 deletion cmd/ggman/ggman_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
//spellchecker:words main
package main

//spellchecker:words testing github ggman internal mockenv pkglib docfmt
import (
"testing"

"github.com/tkw1536/ggman/internal/mockenv"
"github.com/tkw1536/pkglib/docfmt"
)

//spellchecker:words doccheck

// This test runs every command once with the --help flag
//
// This tests that the Description() functions do not fail.
// This also checks that all the docstrings are valid if the doccheck flag is specified.
// This also checks that all the doc strings are valid if the doccheck flag is specified.
func Test_main_docs(t *testing.T) {
mock := mockenv.NewMockEnv(t)

Expand Down
3 changes: 3 additions & 0 deletions cmd/here.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package cmd

//spellchecker:words github ggman
import (
"github.com/tkw1536/ggman"
"github.com/tkw1536/ggman/env"
)

//spellchecker:words worktree

// Here is the 'ggman here' command.
//
// 'ggman here' prints the path to the root of the repository in the current working directory to standard output.
Expand Down
3 changes: 3 additions & 0 deletions cmd/here_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cmd

//spellchecker:words path filepath testing github ggman internal mockenv
import (
"os"
"path/filepath"
Expand All @@ -8,6 +9,8 @@ import (
"github.com/tkw1536/ggman/internal/mockenv"
)

//spellchecker:words workdir GGROOT

func TestCommandHere(t *testing.T) {
mock := mockenv.NewMockEnv(t)

Expand Down
1 change: 1 addition & 0 deletions cmd/license.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cmd

//spellchecker:words github ggman constants legal
import (
"github.com/tkw1536/ggman"
"github.com/tkw1536/ggman/constants/legal"
Expand Down
3 changes: 3 additions & 0 deletions cmd/license_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cmd

//spellchecker:words testing github ggman constants legal internal mockenv
import (
"fmt"
"testing"
Expand All @@ -9,6 +10,8 @@ import (
"github.com/tkw1536/ggman/internal/mockenv"
)

//spellchecker:words workdir

func TestCommandLicense(t *testing.T) {
mock := mockenv.NewMockEnv(t)

Expand Down
3 changes: 3 additions & 0 deletions cmd/link.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cmd

//spellchecker:words path filepath github ggman goprogram exit pkglib
import (
"os"
"path/filepath"
Expand All @@ -10,6 +11,8 @@ import (
"github.com/tkw1536/pkglib/fsx"
)

//spellchecker:words positionals

// Link is the 'ggman link' command.
//
// The 'ggman link' symlinks the repository in the path passed as the first argument where it would have been cloned to inside 'ggman root'.
Expand Down
3 changes: 3 additions & 0 deletions cmd/link_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package cmd

//spellchecker:words testing github ggman internal mockenv
import (
"fmt"
"testing"

"github.com/tkw1536/ggman/internal/mockenv"
)

//spellchecker:words workdir GGROOT

func TestCommandLink(t *testing.T) {
mock := mockenv.NewMockEnv(t)

Expand Down
1 change: 1 addition & 0 deletions cmd/ls.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cmd

//spellchecker:words github ggman goprogram exit
import (
"github.com/tkw1536/ggman"
"github.com/tkw1536/ggman/env"
Expand Down
Loading

0 comments on commit 9c93ae9

Please sign in to comment.