Skip to content

Commit b51b5cd

Browse files
committed
spell: turn on spell checker for Go code
Part of #TNTP-3105
1 parent fe66821 commit b51b5cd

File tree

100 files changed

+315
-261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+315
-261
lines changed

cli/binary/switch.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@ type SwitchCtx struct {
2929
Version string
3030
}
3131

32+
// spell-checker:disable
3233
// ansi is a string to clean strings from ANSI escape codes using regexp.
3334
const ansi = "[\u001B\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;" +
3435
"[a-zA-Z\\d]*)*)?\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"
3536

37+
// spell-checker:enable
38+
3639
func cleanString(str string) string {
3740
re := regexp.MustCompile(ansi)
3841
return re.ReplaceAllString(str, "")

cli/checkpoint/checkpoint.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ func Cat(tntCli cmdcontext.TarantoolCli) error {
4747
// Play is playing the contents of .snap/.xlog files to another Tarantool instance.
4848
// Returns an error if such occur during playing.
4949
func Play(tntCli cmdcontext.TarantoolCli) error {
50-
var errbuff bytes.Buffer
50+
var errBuff bytes.Buffer
5151
cmd := exec.Command(tntCli.Executable, "-")
52-
cmd.Stderr = &errbuff
52+
cmd.Stderr = &errBuff
5353

5454
stdoutPipe, err := cmd.StdoutPipe()
5555
if err != nil {
@@ -63,7 +63,7 @@ func Play(tntCli cmdcontext.TarantoolCli) error {
6363
stdinPipe.Close()
6464

6565
if err := cmd.Start(); err != nil {
66-
return fmt.Errorf("result of play: %s", errbuff.String())
66+
return fmt.Errorf("result of play: %s", errBuff.String())
6767
}
6868

6969
scanner := bufio.NewScanner(stdoutPipe)
@@ -73,8 +73,8 @@ func Play(tntCli cmdcontext.TarantoolCli) error {
7373
}
7474
cmd.Wait()
7575

76-
if len(errbuff.String()) > 0 {
77-
return fmt.Errorf("result of play: %s", errbuff.String())
76+
if len(errBuff.String()) > 0 {
77+
return fmt.Errorf("result of play: %s", errBuff.String())
7878
}
7979

8080
return nil

cli/cluster/cmd/publish.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/tarantool/tt/lib/connect"
88
)
99

10-
// PublishCtx contains information abould cluster publish command execution
10+
// PublishCtx contains information about cluster publish command execution
1111
// context.
1212
type PublishCtx struct {
1313
// Username defines a username for connection.

cli/cluster/integration_test.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import (
2121
libcluster "github.com/tarantool/tt/lib/cluster"
2222
)
2323

24+
// spell-checker:ignore etcdmode etcddir etcdapp
25+
2426
const timeout = 5 * time.Second
2527

2628
type etcdOpts struct {
@@ -40,7 +42,7 @@ func doWithCtx(action func(context.Context) error) error {
4042
func startEtcd(t *testing.T, opts etcdOpts) integration.LazyCluster {
4143
t.Helper()
4244

43-
mydir, err := os.Getwd()
45+
myDir, err := os.Getwd()
4446
if err != nil {
4547
t.Fatalf("Failed to get current working directory: %s", err)
4648
}
@@ -49,15 +51,15 @@ func startEtcd(t *testing.T, opts etcdOpts) integration.LazyCluster {
4951
if opts.CaFile != "" || opts.CertFile != "" || opts.KeyFile != "" {
5052
tls = &transport.TLSInfo{}
5153
if opts.CaFile != "" {
52-
caPath := filepath.Join(mydir, opts.CaFile)
54+
caPath := filepath.Join(myDir, opts.CaFile)
5355
tls.TrustedCAFile = caPath
5456
}
5557
if opts.CertFile != "" {
56-
certPath := filepath.Join(mydir, opts.CertFile)
58+
certPath := filepath.Join(myDir, opts.CertFile)
5759
tls.CertFile = certPath
5860
}
5961
if opts.KeyFile != "" {
60-
keyPath := filepath.Join(mydir, opts.KeyFile)
62+
keyPath := filepath.Join(myDir, opts.KeyFile)
6163
tls.KeyFile = keyPath
6264
}
6365
}
@@ -121,15 +123,15 @@ func startEtcd(t *testing.T, opts etcdOpts) integration.LazyCluster {
121123
func etcdPut(t *testing.T, etcd *clientv3.Client, key, value string) {
122124
t.Helper()
123125
var (
124-
presp *clientv3.PutResponse
126+
pResp *clientv3.PutResponse
125127
err error
126128
)
127129
doWithCtx(func(ctx context.Context) error {
128-
presp, err = etcd.Put(ctx, key, value)
130+
pResp, err = etcd.Put(ctx, key, value)
129131
return nil
130132
})
131133
require.NoError(t, err)
132-
require.NotNil(t, presp)
134+
require.NotNil(t, pResp)
133135
}
134136

135137
func etcdGet(t *testing.T, etcd *clientv3.Client, key string) ([]byte, int64) {

cli/cmd/aeon.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const (
2727
aeonHistoryLines = console.DefaultHistoryLines
2828
)
2929

30-
var aoenHelp = libconnect.MakeURLHelp(map[string]any{
30+
var aeonHelp = libconnect.MakeURLHelp(map[string]any{
3131
"service": "etcd or tarantool config storage",
3232
"param_key": "a target configuration key in the prefix",
3333
"param_name": "a name of an instance in the cluster configuration",
@@ -48,7 +48,7 @@ func newAeonConnectCmd() *cobra.Command {
4848
tt aeon connect unix://<socket-path>
4949
tt aeon connect /path/to/config INSTANCE_NAME
5050
tt aeon connect https://user:pass@localhost:2379/prefix INSTANCE` + "\n\n" +
51-
aoenHelp,
51+
aeonHelp,
5252
PreRunE: func(cmd *cobra.Command, args []string) error {
5353
err := aeonConnectValidateArgs(cmd, args)
5454
util.HandleCmdErr(cmd, err)

cli/cmd/cartridge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func generateRunDirForCartridge(env config.TtEnvOpts, configDir, runDir, appName
3434
return util.JoinAbspath(env.InstancesEnabled, appName, runDir)
3535
}
3636

37-
// NewCartridgeCmd chains commands from cartridge-cli to our corba tree.
37+
// NewCartridgeCmd chains commands from cartridge-cli to our cobra tree.
3838
func NewCartridgeCmd() *cobra.Command {
3939
cartridgeCmd := &cobra.Command{
4040
Use: "cartridge",

cli/cmd/check.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func internalCheckModule(cmdCtx *cmdcontext.CmdCtx, args []string) error {
3030
return err
3131
}
3232

33-
// Сollect a list of instances with unique scripts.
33+
// Collect a list of instances with unique scripts.
3434
uniqueInst := []running.InstanceCtx{}
3535
for _, inst := range runningCtx.Instances {
3636
found := false

cli/cmd/create_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,23 @@ func TestCreateValidArgsFunction(t *testing.T) {
2828
}()
2929
os.Create(tempsDir1 + "/" + "excess.A")
3030
os.Create(tempsDir1 + "/" + "archive.tgz")
31-
tdir1, _ := os.MkdirTemp(tempsDir1, "template1")
31+
tDir1, _ := os.MkdirTemp(tempsDir1, "template1")
3232

3333
os.Create(tempsDir2 + "/" + "excess.B")
3434
os.Create(tempsDir2 + "/" + "template2.tar.gz")
35-
tdir2, _ := os.MkdirTemp(tempsDir2, "template2")
35+
tDir2, _ := os.MkdirTemp(tempsDir2, "template2")
3636

37-
_, tdir1Name := filepath.Split(tdir1)
38-
_, tdir2Name := filepath.Split(tdir2)
37+
_, tDir1Name := filepath.Split(tDir1)
38+
_, tDir2Name := filepath.Split(tDir2)
3939

4040
templates := []string{
4141
"cartridge",
4242
"vshard_cluster",
4343
"single_instance",
4444
"archive",
4545
"template2",
46-
tdir1Name,
47-
tdir2Name,
46+
tDir1Name,
47+
tDir2Name,
4848
}
4949

5050
t.Run("empty args", func(t *testing.T) {

cli/cmd/enable.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ func NewEnableCmd() *cobra.Command {
1717
"to a script or an application directory",
1818
Example: `
1919
# Create a symbolic link in 'instances_enabled' directory to a script.
20-
$ tt enable Users/myuser/my_scripts/script.lua
20+
$ tt enable Users/my_user/my_scripts/script.lua
2121
# Create a symbolic link in 'instances_enabled' directory to an application directory.
22-
$ tt enable ../myuser/my_cool_app`,
22+
$ tt enable ../my_user/my_cool_app`,
2323
Run: RunModuleFunc(internalEnableModule),
2424
Args: func(cmd *cobra.Command, args []string) error {
2525
if len(args) != 1 {

cli/cmd/help.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ func getExternalCommandsString(modulesInfo *modules.ModulesInfo) string {
5454
return ""
5555
}
5656

57+
// spell-checker:ignore rpad
58+
5759
var usageTemplate = util.Bold("USAGE") + `
5860
{{- if (and .Runnable .HasAvailableInheritedFlags)}}
5961
{{.UseLine}}

0 commit comments

Comments
 (0)