Skip to content

Commit 4d26c4a

Browse files
authored
Merge pull request opencontainers#3144 from kolyshkin/codespell
Fix codespell warnings, add codespell to ci
2 parents ba7a877 + 75761bc commit 4d26c4a

File tree

16 files changed

+30
-17
lines changed

16 files changed

+30
-17
lines changed

.codespellrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[codespell]
2+
skip = ./vendor,./.git
3+
ignore-words-list = clos,creat

.github/workflows/validate.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ jobs:
3030
- name: compile with no build tags
3131
run: make BUILDTAGS=""
3232

33+
codespell:
34+
runs-on: ubuntu-20.04
35+
steps:
36+
- uses: actions/checkout@v2
37+
- name: install deps
38+
# Version of codespell bundled with Ubuntu is way old, so use pip.
39+
run: pip install codespell
40+
- name: run codespell
41+
run: codespell
42+
3343
shfmt:
3444
runs-on: ubuntu-20.04
3545
steps:

docs/systemd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
By default, runc creates cgroups and sets cgroup limits on its own (this mode
44
is known as fs cgroup driver). When `--systemd-cgroup` global option is given
55
(as in e.g. `runc --systemd-cgroup run ...`), runc switches to systemd cgroup
6-
driver. This document describes its features and pecularities.
6+
driver. This document describes its features and peculiarities.
77

88
### systemd unit name and placement
99

libcontainer/cgroups/devices/devices_emulator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ func EmulatorFromList(list io.Reader) (*Emulator, error) {
305305
// necessary.
306306
//
307307
// This function is the sole reason for all of Emulator -- to allow us
308-
// to figure out how to update a containers' cgroups without causing spurrious
308+
// to figure out how to update a containers' cgroups without causing spurious
309309
// device errors (if possible).
310310
func (source *Emulator) Transition(target *Emulator) ([]*devices.Rule, error) {
311311
var transitionRules []*devices.Rule

libcontainer/cgroups/ebpf/ebpf_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func haveBpfProgReplace() bool {
134134
// not supported
135135
return
136136
}
137-
// attach_flags test succeded.
137+
// attach_flags test succeeded.
138138
if !errors.Is(err, unix.EBADF) {
139139
logrus.Debugf("checking for BPF_F_REPLACE: got unexpected (not EBADF or EINVAL) error: %v", err)
140140
}

libcontainer/cgroups/fs/cpuset.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@ func getCpusetStat(path string, file string) ([]uint16, error) {
5151
}
5252

5353
for _, s := range strings.Split(fileContent, ",") {
54-
splitted := strings.SplitN(s, "-", 3)
55-
switch len(splitted) {
54+
sp := strings.SplitN(s, "-", 3)
55+
switch len(sp) {
5656
case 3:
5757
return extracted, &parseError{Path: path, File: file, Err: errors.New("extra dash")}
5858
case 2:
59-
min, err := strconv.ParseUint(splitted[0], 10, 16)
59+
min, err := strconv.ParseUint(sp[0], 10, 16)
6060
if err != nil {
6161
return extracted, &parseError{Path: path, File: file, Err: err}
6262
}
63-
max, err := strconv.ParseUint(splitted[1], 10, 16)
63+
max, err := strconv.ParseUint(sp[1], 10, 16)
6464
if err != nil {
6565
return extracted, &parseError{Path: path, File: file, Err: err}
6666
}

libcontainer/cgroups/fs/stats_util_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func expectBlkioStatsEquals(t *testing.T, expected, actual cgroups.BlkioStats) {
5151
}
5252

5353
if err := blkioStatEntryEquals(expected.IoMergedRecursive, actual.IoMergedRecursive); err != nil {
54-
t.Errorf("blkio IoMergedRecursive do not match: expcted: %v, actual: %v", expected.IoMergedRecursive, actual.IoMergedRecursive)
54+
t.Errorf("blkio IoMergedRecursive do not match: expected: %v, actual: %v", expected.IoMergedRecursive, actual.IoMergedRecursive)
5555
}
5656

5757
if err := blkioStatEntryEquals(expected.IoTimeRecursive, actual.IoTimeRecursive); err != nil {

libcontainer/cgroups/stats.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ type BlkioStatEntry struct {
126126
}
127127

128128
type BlkioStats struct {
129-
// number of bytes tranferred to and from the block device
129+
// number of bytes transferred to and from the block device
130130
IoServiceBytesRecursive []BlkioStatEntry `json:"io_service_bytes_recursive,omitempty"`
131131
IoServicedRecursive []BlkioStatEntry `json:"io_serviced_recursive,omitempty"`
132132
IoQueuedRecursive []BlkioStatEntry `json:"io_queue_recursive,omitempty"`

libcontainer/cgroups/systemd/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func generateDeviceProperties(r *configs.Resources) ([]systemdDbus.Property, err
198198
}
199199
// systemd doesn't support blacklists. So we log a warning, and tell
200200
// systemd to act as a deny-all whitelist. This ruleset will be replaced
201-
// with our normal fallback code. This may result in spurrious errors, but
201+
// with our normal fallback code. This may result in spurious errors, but
202202
// the only other option is to error out here.
203203
if configEmu.IsBlacklist() {
204204
// However, if we're dealing with an allow-all rule then we can do it.

libcontainer/cgroups/systemd/systemd_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ func TestFreezePodCgroup(t *testing.T) {
341341
containerConfig := &configs.Cgroup{
342342
Parent: "system-runc_test_pod.slice",
343343
ScopePrefix: "test",
344-
Name: "inner-contianer",
344+
Name: "inner-container",
345345
Resources: &configs.Resources{},
346346
}
347347

0 commit comments

Comments
 (0)