Skip to content

Commit dda4eb4

Browse files
authored
Merge pull request #20815 from ivanvc/replace-goword-with-misspell
Replace goword with golangci-lint misspell
2 parents 709e094 + 2811b23 commit dda4eb4

File tree

11 files changed

+10
-53
lines changed

11 files changed

+10
-53
lines changed

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fuzz:
9696

9797
# Static analysis
9898
.PHONY: verify
99-
verify: verify-gofmt verify-bom verify-lint verify-dep verify-shellcheck verify-goword \
99+
verify: verify-gofmt verify-bom verify-lint verify-dep verify-shellcheck \
100100
verify-license-header verify-mod-tidy \
101101
verify-shellws verify-proto-annotations verify-genproto verify-yamllint \
102102
verify-markdown-marker verify-go-versions verify-gomodguard \
@@ -134,10 +134,6 @@ fix-lint:
134134
verify-shellcheck:
135135
PASSES="shellcheck" ./scripts/test.sh
136136

137-
.PHONY: verify-goword
138-
verify-goword:
139-
PASSES="goword" ./scripts/test.sh
140-
141137
.PHONY: verify-license-header
142138
verify-license-header:
143139
PASSES="license_header" ./scripts/test.sh

etcdctl/ctlv3/command/snapshot_command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var snapshotExample = util.Normalize(`
3737
# Get snapshot from given address with certificates
3838
etcdctl --endpoints=https://127.0.0.1:2379 --cacert=/etc/etcd/ca.crt --cert=/etc/etcd/etcd.crt --key=/etc/etcd/etcd.key snapshot save /backup/etcd-snapshot.db
3939
40-
# Get snapshot wih certain user and password
40+
# Get snapshot with certain user and password
4141
etcdctl --user=root --password=password123 snapshot save /backup/etcd-snapshot.db
4242
4343
# Get snapshot from given address with timeout

scripts/test.sh

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -421,36 +421,6 @@ function license_header_pass {
421421
run_for_modules generic_checker license_header_per_module
422422
}
423423

424-
# goword_for_package package
425-
# checks spelling and comments in the 'package' in the current module
426-
#
427-
function goword_for_package {
428-
# bash 3.x compatible replacement of: mapfile -t gofiles < <(go_srcs_in_module)
429-
local gofiles=()
430-
while IFS= read -r line; do gofiles+=("$line"); done < <(go_srcs_in_module)
431-
432-
local gowordRes
433-
434-
# spellchecking can be enabled with GOBINARGS="--tags=spell"
435-
# but it requires heavy dependencies installation, like:
436-
# apt-get install libaspell-dev libhunspell-dev hunspell-en-us aspell-en
437-
438-
# only check for broke exported godocs
439-
if gowordRes=$(run_go_tool "github.com/chzchzchz/goword" -use-spell=false "${gofiles[@]}" | grep godoc-export | sort); then
440-
log_error -e "goword checking failed:\\n${gowordRes}"
441-
return 255
442-
fi
443-
if [ -n "$gowordRes" ]; then
444-
log_error -e "goword checking returned output:\\n${gowordRes}"
445-
return 255
446-
fi
447-
}
448-
449-
450-
function goword_pass {
451-
run_for_modules goword_for_package || return 255
452-
}
453-
454424
function go_fmt_for_package {
455425
# We utilize 'go fmt' to find all files suitable for formatting,
456426
# but reuse full power gofmt to perform just RO check.

tests/common/lease_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func TestLeaseGrantTimeToLiveExpired(t *testing.T) {
143143
// back to follower and ignores the lease revoking.
144144
// The new leader will restart TTL counting. If so,
145145
// we should call time.Sleep again and wait for revoking.
146-
// It can't avoid flakey but reduce flakey possiblility.
146+
// It can't avoid flakey but reduce flakey possibility.
147147
for i := 0; i < 3; i++ {
148148
currentLeader := clus.WaitLeader(t)
149149
t.Logf("[%d] current leader index %d", i, currentLeader)
@@ -192,7 +192,7 @@ func TestLeaseGrantKeepAliveOnce(t *testing.T) {
192192
// back to follower and ignores the lease revoking.
193193
// The new leader will restart TTL counting. If so,
194194
// we should call time.Sleep again and wait for revoking.
195-
// It can't avoid flakey but reduce flakey possiblility.
195+
// It can't avoid flakey but reduce flakey possibility.
196196
for i := 0; i < 3; i++ {
197197
currentLeader := clus.WaitLeader(t)
198198
t.Logf("[%d] current leader index %d", i, currentLeader)

tests/e2e/reproduce_20271_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ to override boltdb file. So, for the following changes, the third member will co
9090
require.NoError(t, err)
9191
}
9292

93-
t.Log("Step 7: Restart the third member. It recovers from the new boltdb file. Therefore, data writen in Step 6 is lost.")
93+
t.Log("Step 7: Restart the third member. It recovers from the new boltdb file. Therefore, data written in Step 6 is lost.")
9494
require.NoError(t, epc.Procs[2].Restart(ctx))
9595

9696
t.Log("Step 8: Check hashkv of each member")

tests/integration/tracing_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func TestTracing(t *testing.T) {
168168
rpc: func(ctx context.Context, cli *clientv3.Client) error {
169169
_, err := cli.KeepAliveOnce(ctx, 2345)
170170
if err != nil && strings.Contains(err.Error(), "requested lease not found") {
171-
// errors.Is does not work accross gRPC bounduaries.
171+
// errors.Is does not work across gRPC bounduaries.
172172
return nil
173173
}
174174
return err
@@ -188,7 +188,7 @@ func TestTracing(t *testing.T) {
188188
rpc: func(ctx context.Context, cli *clientv3.Client) error {
189189
_, err := cli.Revoke(ctx, 1234)
190190
if err != nil && strings.Contains(err.Error(), "requested lease not found") {
191-
// errors.Is does not work accross gRPC bounduaries.
191+
// errors.Is does not work across gRPC bounduaries.
192192
return nil
193193
}
194194
return err
@@ -329,7 +329,7 @@ func testRPCTracing(t *testing.T, wantSpan *v1.Span, clientAction func(context.C
329329
cfg.EnableDistributedTracing = true
330330
cfg.DistributedTracingAddress = listener.Addr().String()
331331
cfg.DistributedTracingServiceName = "integration-test-tracing"
332-
cfg.DistributedTracingSamplingRatePerMillion = 100 // overriden later in the test
332+
cfg.DistributedTracingSamplingRatePerMillion = 100 // overridden later in the test
333333

334334
// start an etcd instance with tracing enabled
335335
etcdSrv, err := embed.StartEtcd(cfg)

tools/.golangci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ linters:
66
- errorlint
77
- govet
88
- ineffassign
9+
- misspell
910
- nakedret
1011
- revive
1112
- staticcheck

tools/etcd-dump-db/scan.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func scanKeys(dbPath string, startRev int64) error {
3131
for pageID := uint64(2); pageID < hwm; {
3232
p, _, err := readPage(dbPath, pgSize, pageID)
3333
if err != nil {
34-
fmt.Fprintf(os.Stderr, "Reading page %d failed: %v. Continuting...\n", pageID, err)
34+
fmt.Fprintf(os.Stderr, "Reading page %d failed: %v. Continuing...\n", pageID, err)
3535
pageID++
3636
continue
3737
}

tools/mod/go.mod

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ toolchain go1.25.3
77
require (
88
github.com/alexfalkowski/gocovmerge v1.11.0
99
github.com/appscodelabs/license-bill-of-materials v0.0.0-20220707232035-6018e0c5287c
10-
github.com/chzchzchz/goword v0.0.0-20170907005317-a9744cb52b03
1110
github.com/cloudflare/cfssl v1.6.5
1211
github.com/gogo/protobuf v1.3.2
1312
github.com/golangci/golangci-lint/v2 v2.5.0
@@ -43,7 +42,6 @@ require (
4342
github.com/Masterminds/semver/v3 v3.3.1 // indirect
4443
github.com/MirrexOne/unqueryvet v1.2.1 // indirect
4544
github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect
46-
github.com/akhenakh/hunspellgo v0.0.0-20160221122622-9db38fa26e19 // indirect
4745
github.com/alecthomas/chroma/v2 v2.20.0 // indirect
4846
github.com/alecthomas/go-check-sumtype v0.3.1 // indirect
4947
github.com/alexkohler/nakedret/v2 v2.0.6 // indirect
@@ -214,7 +212,6 @@ require (
214212
github.com/timonwong/loggercheck v0.11.0 // indirect
215213
github.com/tomarrell/wrapcheck/v2 v2.11.0 // indirect
216214
github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect
217-
github.com/trustmaster/go-aspell v0.0.0-20200701131845-c2b1f55bec8f // indirect
218215
github.com/ultraware/funlen v0.2.0 // indirect
219216
github.com/ultraware/whitespace v0.2.0 // indirect
220217
github.com/uudashr/gocognit v1.2.0 // indirect

tools/mod/go.sum

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ github.com/MirrexOne/unqueryvet v1.2.1/go.mod h1:IWwCwMQlSWjAIteW0t+28Q5vouyktfu
3636
github.com/OpenPeeDeeP/depguard/v2 v2.2.1 h1:vckeWVESWp6Qog7UZSARNqfu/cZqvki8zsuj3piCMx4=
3737
github.com/OpenPeeDeeP/depguard/v2 v2.2.1/go.mod h1:q4DKzC4UcVaAvcfd41CZh0PWpGgzrVxUYBlgKNGquUo=
3838
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g=
39-
github.com/akhenakh/hunspellgo v0.0.0-20160221122622-9db38fa26e19 h1:bYOD6QJnBJY79MJQR1i9cyQePG5oNDZXDKL2bhN/uvE=
40-
github.com/akhenakh/hunspellgo v0.0.0-20160221122622-9db38fa26e19/go.mod h1:HcqyLXmWoESd/vPSbCPqvgw5l5cMM5PtoqFOnXLjSeM=
4139
github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0=
4240
github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k=
4341
github.com/alecthomas/chroma/v2 v2.20.0 h1:sfIHpxPyR07/Oylvmcai3X/exDlE8+FA820NTz+9sGw=
@@ -108,8 +106,6 @@ github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd h1:vy0G
108106
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs=
109107
github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
110108
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
111-
github.com/chzchzchz/goword v0.0.0-20170907005317-a9744cb52b03 h1:0wUHjDfbCAROEAZ96zAJGwcNMkPIheFaIjtQyv3QqfM=
112-
github.com/chzchzchz/goword v0.0.0-20170907005317-a9744cb52b03/go.mod h1:uFE9hX+zXEwvyUThZ4gDb9vkAwc5DoHUnRSEpH0VrOs=
113109
github.com/ckaznocha/intrange v0.3.1 h1:j1onQyXvHUsPWujDH6WIjhyH26gkRt/txNlV7LspvJs=
114110
github.com/ckaznocha/intrange v0.3.1/go.mod h1:QVepyz1AkUoFQkpEqksSYpNpUo3c5W7nWh/s6SHIJJk=
115111
github.com/cloudflare/cfssl v1.6.5 h1:46zpNkm6dlNkMZH/wMW22ejih6gIaJbzL2du6vD7ZeI=
@@ -494,8 +490,6 @@ github.com/tomarrell/wrapcheck/v2 v2.11.0 h1:BJSt36snX9+4WTIXeJ7nvHBQBcm1h2SjQMS
494490
github.com/tomarrell/wrapcheck/v2 v2.11.0/go.mod h1:wFL9pDWDAbXhhPZZt+nG8Fu+h29TtnZ2MW6Lx4BRXIU=
495491
github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw=
496492
github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw=
497-
github.com/trustmaster/go-aspell v0.0.0-20200701131845-c2b1f55bec8f h1:92ZQJRegaqnKjz9HY9an696Sw5EmAqRv0eie/U2IE6k=
498-
github.com/trustmaster/go-aspell v0.0.0-20200701131845-c2b1f55bec8f/go.mod h1:wxUiQ1klFJmwnM41kQI7IT2g8jjOKbtuL54LdjkxAI0=
499493
github.com/ultraware/funlen v0.2.0 h1:gCHmCn+d2/1SemTdYMiKLAHFYxTYz7z9VIDRaTGyLkI=
500494
github.com/ultraware/funlen v0.2.0/go.mod h1:ZE0q4TsJ8T1SQcjmkhN/w+MceuatI6pBFSxxyteHIJA=
501495
github.com/ultraware/whitespace v0.2.0 h1:TYowo2m9Nfj1baEQBjuHzvMRbp19i+RCcRYrSWoFa+g=

0 commit comments

Comments
 (0)