Skip to content

Commit d759beb

Browse files
committed
ci: fix static check errors
Closes TNTP-6083
1 parent c9a40f1 commit d759beb

File tree

10 files changed

+85
-30
lines changed

10 files changed

+85
-30
lines changed

.cspell.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,9 @@ ignoreRegExpList:
3030
- ^\s+(\w+\s+)?"github.com/.*" # Ignore Go import paths.
3131
- -D[A-Z\d_]+ # Ignore CMake flags "-DFLAG_NAME".
3232
- \d+-g[a-f\d]{4,} # Ignore git commit hashes in version string.
33+
34+
ignorePaths:
35+
- magefile.go
36+
- /test/**
37+
- "*-gdb.py"
38+
- "*_test.go"

.cspell_project-words.txt

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,24 @@
44
+s
55
addfinalizer
66
aeon*
7+
anyhost
8+
anykey
9+
anyname
710
autoexpel
811
bootstrapper
12+
byted
913
ccluster
14+
cconfig
1015
clientv3
1116
clustercmd
17+
cmdconfig
18+
cmdcontext
19+
cmps
1220
commentf
1321
configcartridgecustom
1422
connpool
1523
containsf
24+
coredumps
1625
debugf
1726
demoter
1827
disbalance
@@ -24,52 +33,91 @@ etcd*
2433
etcdserver
2534
evaler
2635
falsef
36+
filemodes
2737
finalizer*
2838
flightrec
39+
framelink
40+
frametypes
2941
getfixturevalue
3042
golangci
43+
iconfig
3144
incdir
3245
infof
46+
iproto
47+
jsonmessage
3348
leaderuuid
3449
libcluster
50+
libconnect
51+
linecomment
3552
luabody
3653
luajit
3754
luakit
3855
luarocks
56+
magefile
57+
MAKEFLAGS
3958
mapstructure
4059
memtx
60+
multireturn
4161
mvcc
4262
mvccpb
63+
myapp
4364
nilf
4465
nodeps
4566
nogc
4667
nolint
4768
notarantool
69+
oldfd
70+
outputformat
71+
packignore
72+
payloadsize
73+
pflag
74+
pkgs
75+
postinst
76+
preinst
4877
promptui
4978
protoc
79+
pseudographics
5080
rebootstrap
81+
regexputil
5182
replicaset*
83+
rescan
5284
rockspec*
5385
rpmdeb
86+
rundir
87+
socketpath
88+
sourcedir
5489
specialchars
5590
sslcafile
91+
sslcertfile
5692
sslciphers
93+
sslkeyfile
5794
stateboard
95+
stdcopy
96+
submatch
5897
svacer
98+
sysdetect
99+
tagset
59100
tarantool*
101+
testfull
102+
tinstance
60103
tlsdialer
104+
tmpfiles
61105
tmpl
62106
tnt+
63107
tntp
64108
trimprefix
65109
truef
110+
ttable
111+
ttlog
112+
typestr
66113
unknowncentralized
67114
unknownnonetarantooletcd
68115
unknownnosinglemulti
69116
unknownoffmanualeventualelectionstatefulsupervised
70117
unknownoffvotercandidatemanual
71118
unknownreadrw
72119
unknownuninitializedbootstrapped
120+
vclock
73121
vshard
74122
vylog
75123
warnf

cli/aeon/decode.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
//
1616
// Copy from https://github.com/tarantool/aeon/blob/master/aeon/grpc/server/pb/decode.go
1717
func decodeValue(val *pb.Value) (any, error) {
18+
// spell-checker:ignore Varbinary
1819
switch casted := val.Kind.(type) {
1920
case *pb.Value_UnsignedValue:
2021
return val.GetUnsignedValue(), nil

cli/replicaset/cconfig.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -219,19 +219,19 @@ func (c *CConfigApplication) Expel(ctx ExpelCtx) error {
219219
}
220220

221221
var instances []running.InstanceCtx
222-
var unfound []string
222+
var unavailable []string
223223
for _, inst := range targetReplicaset.Instances {
224224
if !inst.InstanceCtxFound {
225225
if inst.Alias != ctx.InstName {
226226
// The target instance could be offline.
227-
unfound = append(unfound, inst.Alias)
227+
unavailable = append(unavailable, inst.Alias)
228228
}
229229
} else {
230230
instances = append(instances, inst.InstanceCtx)
231231
}
232232
}
233-
if len(unfound) > 0 {
234-
msg := fmt.Sprintf("could not connect to: %s", strings.Join(unfound, ","))
233+
if len(unavailable) > 0 {
234+
msg := fmt.Sprintf("could not connect to: %s", strings.Join(unavailable, ","))
235235
if !ctx.Force {
236236
return fmt.Errorf(
237237
"all other instances in the target replicaset should be online, %s", msg)
@@ -367,16 +367,16 @@ func (c *CConfigApplication) Promote(ctx PromoteCtx) error {
367367
}
368368

369369
var instances []running.InstanceCtx
370-
var unfound []string
370+
var unavailable []string
371371
for _, inst := range targetReplicaset.Instances {
372372
if !inst.InstanceCtxFound {
373-
unfound = append(unfound, inst.Alias)
373+
unavailable = append(unavailable, inst.Alias)
374374
} else {
375375
instances = append(instances, inst.InstanceCtx)
376376
}
377377
}
378-
if len(unfound) > 0 {
379-
msg := fmt.Sprintf("could not connect to: %s", strings.Join(unfound, ","))
378+
if len(unavailable) > 0 {
379+
msg := fmt.Sprintf("could not connect to: %s", strings.Join(unavailable, ","))
380380
if !ctx.Force {
381381
return fmt.Errorf("all instances in the target replicaset should be online, %s", msg)
382382
}
@@ -406,16 +406,16 @@ func (c *CConfigApplication) Demote(ctx DemoteCtx) error {
406406
}
407407

408408
var instances []running.InstanceCtx
409-
var unfound []string
409+
var unavailable []string
410410
for _, inst := range targetReplicaset.Instances {
411411
if !inst.InstanceCtxFound {
412-
unfound = append(unfound, inst.Alias)
412+
unavailable = append(unavailable, inst.Alias)
413413
} else {
414414
instances = append(instances, inst.InstanceCtx)
415415
}
416416
}
417-
if len(unfound) > 0 {
418-
msg := fmt.Sprintf("could not connect to: %s", strings.Join(unfound, ","))
417+
if len(unavailable) > 0 {
418+
msg := fmt.Sprintf("could not connect to: %s", strings.Join(unavailable, ","))
419419
if !ctx.Force {
420420
return fmt.Errorf("all instances in the target replicaset should be online, %s", msg)
421421
}
@@ -486,8 +486,8 @@ func (c *CConfigApplication) RolesChange(ctx RolesChangeCtx,
486486
}
487487

488488
var (
489-
instances []running.InstanceCtx
490-
unfound []string
489+
instances []running.InstanceCtx
490+
unavailable []string
491491
)
492492

493493
if ctx.InstName != "" {
@@ -501,7 +501,7 @@ func (c *CConfigApplication) RolesChange(ctx RolesChangeCtx,
501501
}
502502
for _, inst := range targetReplicaset.Instances {
503503
if !inst.InstanceCtxFound {
504-
unfound = append(unfound, inst.Alias)
504+
unavailable = append(unavailable, inst.Alias)
505505
continue
506506
}
507507
instances = append(instances, inst.InstanceCtx)
@@ -510,15 +510,15 @@ func (c *CConfigApplication) RolesChange(ctx RolesChangeCtx,
510510
for _, r := range c.replicasets.Replicasets {
511511
for _, i := range r.Instances {
512512
if !i.InstanceCtxFound {
513-
unfound = append(unfound, i.Alias)
513+
unavailable = append(unavailable, i.Alias)
514514
continue
515515
}
516516
instances = append(instances, i.InstanceCtx)
517517
}
518518
}
519519
}
520-
if len(unfound) > 0 {
521-
msg := "could not connect to: " + strings.Join(unfound, ",")
520+
if len(unavailable) > 0 {
521+
msg := "could not connect to: " + strings.Join(unavailable, ",")
522522
if !ctx.Force {
523523
return fmt.Errorf("all instances in the target replicaset should be online, %s", msg)
524524
}

cli/replicaset/cmd/demote.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type DemoteCtx struct {
2424
Conn connector.Connector
2525
// RunningCtx is an application running context.
2626
RunningCtx running.RunningCtx
27-
// Force true if unfound instances can be skipped.
27+
// Force true if unavailable instances can be skipped.
2828
Force bool
2929
// Timeout describes a timeout in seconds.
3030
// We keep int as it can be passed to the target instance.

cli/replicaset/cmd/expel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type ExpelCtx struct {
2323
Orchestrator replicaset.Orchestrator
2424
// RunningCtx is an application running context.
2525
RunningCtx running.RunningCtx
26-
// Force true if unfound instances can be skipped.
26+
// Force true if unavailable instances can be skipped.
2727
Force bool
2828
// Timeout describes a timeout in seconds.
2929
// We keep int as it can be passed to the target instance.

cli/replicaset/cmd/promote.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type PromoteCtx struct {
2727
Conn connector.Connector
2828
// RunningCtx is an application running context.
2929
RunningCtx running.RunningCtx
30-
// Force true if unfound instances can be skipped.
30+
// Force true if unavailable instances can be skipped.
3131
Force bool
3232
// Timeout describes a timeout in seconds.
3333
// We keep int as it can be passed to the target instance.

cli/replicaset/cmd/roles.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type RolesChangeCtx struct {
3535
Conn connector.Connector
3636
// RunningCtx is an application running context.
3737
RunningCtx running.RunningCtx
38-
// Force is true if unfound instances can be skipped.
38+
// Force is true if unavailable instances can be skipped.
3939
Force bool
4040
// Timeout describes a timeout in seconds.
4141
// We keep int as it can be passed to the target instance.

lib/cluster/etcd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,11 +747,11 @@ func (publisher EtcdKeyDataPublisher) Publish(revision int64, data []byte) error
747747
clientv3.OpPut(getSignKey(publisher.prefix, publisher.key), string(sign)))
748748
}
749749

750-
tresp, err := txn.Then(putOps...).Commit()
750+
tResp, err := txn.Then(putOps...).Commit()
751751
if err != nil {
752752
return fmt.Errorf("failed to put data into etcd: %w", err)
753753
}
754-
if !tresp.Succeeded {
754+
if !tResp.Succeeded {
755755
return fmt.Errorf("failed to put data into etcd: wrong revision")
756756
}
757757

magefile.publish.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,16 @@ func PublishRWS() error {
9292
for _, targetDistro := range targetDistros {
9393
fmt.Printf("Publish package for %s/%s...\n", targetDistro.OS, targetDistro.Dist)
9494

95-
patterns, perr := getPatterns(targetDistro)
96-
if perr != nil {
95+
patterns, err := getPatterns(targetDistro)
96+
if err != nil {
9797
return fmt.Errorf("failed to publish package for %s/%s: %s",
98-
targetDistro.OS, targetDistro.Dist, perr)
98+
targetDistro.OS, targetDistro.Dist, err)
9999
}
100100

101-
files, ferr := walkMatch(distPath, patterns)
102-
if ferr != nil {
101+
files, err := walkMatch(distPath, patterns)
102+
if err != nil {
103103
return fmt.Errorf("failed to publish package for %s/%s: %s",
104-
targetDistro.OS, targetDistro.Dist, ferr)
104+
targetDistro.OS, targetDistro.Dist, err)
105105
}
106106

107107
rwsUrlPart := os.Getenv("RWS_URL_PART")

0 commit comments

Comments
 (0)