Skip to content

Commit 4a0a385

Browse files
kolyshkindrakenclimber
authored andcommitted
CI/GHA: add codespell check, fix typos found
1. Fix a few typos found by codespell: ./seccomp_internal.go:820: reponse ==> response ./seccomp.go:267: notication ==> notification ./seccomp_test.go:19: statment ==> statement ./seccomp_test.go:140: nonexistant ==> nonexistent ./seccomp_test.go:363: nonexistant ==> nonexistent ./seccomp_test.go:366: nonexistant ==> nonexistent ./seccomp_test.go:423: correcly ==> correctly 2. Add a CI job to ensure that future PRs won't add typos (at least those that that are known to codespell). Signed-off-by: Kir Kolyshkin <[email protected]> Acked-by: Paul Moore <[email protected]> Signed-off-by: Tom Hromatka <[email protected]>
1 parent 0bfc29a commit 4a0a385

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

.github/workflows/validate.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,12 @@ jobs:
2424
# must be specified without patch version
2525
version: v1.41
2626

27-
27+
codespell:
28+
runs-on: ubuntu-20.04
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: install deps
32+
# Version of codespell bundled with Ubuntu is way old, so use pip.
33+
run: pip install codespell
34+
- name: run codespell
35+
run: codespell

seccomp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ const (
259259
// Userspace notification response flags
260260

261261
// NotifRespFlagContinue tells the kernel to continue executing the system
262-
// call that triggered the notification. Must only be used when the notication
262+
// call that triggered the notification. Must only be used when the notification
263263
// response's error is 0.
264264
NotifRespFlagContinue uint32 = 1
265265
)

seccomp_internal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ func notifRespond(fd ScmpFd, scmpResp *ScmpNotifResp) error {
815815
return err
816816
}
817817

818-
// we only use the reponse here; the request is discarded
818+
// we only use the response here; the request is discarded
819819
if retCode := C.seccomp_notify_alloc(&req, &resp); retCode != 0 {
820820
return errRc(retCode)
821821
}

seccomp_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
)
1515

1616
// execInSubprocess calls the go test binary again for the same test.
17-
// This must be only top-level statment in the test function. Do not nest this.
17+
// This must be only top-level statement in the test function. Do not nest this.
1818
// It will slightly defect the test log output as the test is entered twice
1919
func execInSubprocess(t *testing.T, f func(t *testing.T)) {
2020
const subprocessEnvKey = `GO_SUBPROCESS_KEY`
@@ -137,7 +137,7 @@ func TestSyscallGetName(t *testing.T) {
137137

138138
_, err = callFail.GetName()
139139
if err == nil {
140-
t.Errorf("Getting nonexistant syscall should error!")
140+
t.Errorf("Getting nonexistent syscall should error!")
141141
}
142142
}
143143

@@ -360,10 +360,10 @@ func TestFilterArchFunctions(t *testing.T) {
360360
t.Errorf("Arch not added to filter is present")
361361
}
362362

363-
// Try removing the nonexistant arch - should succeed
363+
// Try removing the nonexistent arch - should succeed
364364
err = filter.RemoveArch(prospectiveArch)
365365
if err != nil {
366-
t.Errorf("Error removing nonexistant arch: %s", err)
366+
t.Errorf("Error removing nonexistent arch: %s", err)
367367
}
368368

369369
// Add an arch, see if it's in the filter
@@ -420,7 +420,7 @@ func TestFilterAttributeGettersAndSetters(t *testing.T) {
420420
if err != nil {
421421
t.Errorf("Error getting bad arch action")
422422
} else if act != ActAllow {
423-
t.Errorf("Bad arch action was not set correcly!")
423+
t.Errorf("Bad arch action was not set correctly!")
424424
}
425425

426426
err = filter.SetNoNewPrivsBit(false)

0 commit comments

Comments
 (0)