Skip to content

Commit 22ee6ac

Browse files
authored
Merge pull request #25 from yarikoptic/enh-codespell
Add codespell support (config, workflow to detect/not fix) and make it fix some typos
2 parents d1bae3d + 73f230c commit 22ee6ac

7 files changed

Lines changed: 39 additions & 7 deletions

File tree

.github/workflows/codespell.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Codespell configuration is within setup.cfg
2+
---
3+
name: Codespell
4+
5+
on:
6+
push:
7+
branches: [master]
8+
pull_request:
9+
branches: [master]
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
codespell:
16+
name: Check for spelling errors
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
- name: Annotate locations with typos
23+
uses: codespell-project/codespell-problem-matcher@v1
24+
- name: Codespell
25+
uses: codespell-project/actions-codespell@v2

docs/_docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ req = (client.NewRequest("PATCH", response.GetRelativeLocation()).
361361
blobResponse = client.Do(req)
362362
```
363363

364-
Finally, valiate the uploaded blob content.
364+
Finally, validate the uploaded blob content.
365365

366366
```python
367367
req = client.NewRequest("GET", "/v2/<name>/blobs/<digest>",

opencontainers/digest/digest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def sepIndex(self):
5656
Return the index of the : separator.
5757
5858
return the index of the : separator or the index
59-
that separtes the extra content provided in the algorithm name.
59+
that separates the extra content provided in the algorithm name.
6060
"""
6161
try:
6262
algorithm, encoded = (self).split(":")

opencontainers/distribution/reggie/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def NewRequest(self, method, path, *opts):
175175
# Set default namespace, and fill in string replacements
176176
namespace = rc.Name or self.Config.DefaultName
177177

178-
# Substitute known path paramaters
178+
# Substitute known path parameters
179179
replacements = {
180180
"<name>": namespace,
181181
"<reference>": rc.Reference,
@@ -199,7 +199,7 @@ def NewRequest(self, method, path, *opts):
199199

200200
def Do(self, req):
201201
"""
202-
Execut a request.
202+
Execute a request.
203203
204204
Given a request (an instance of the RequestClient, execute the request
205205
and return a response.

opencontainers/tests/test_descriptor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def test_descriptor(tmp_path):
215215
with pytest.raises(ErrDigestInvalidFormat):
216216
desc.load(no_hash)
217217

218-
# expected failure: digest does not match pattern (invalid aglorithm characters)
218+
# expected failure: digest does not match pattern (invalid algorithm characters)
219219
with pytest.raises(ErrDigestInvalidFormat):
220220
desc.load(invalid_algchars)
221221

@@ -226,7 +226,7 @@ def test_descriptor(tmp_path):
226226
# expected success: valid URL entry
227227
desc.load(valid_urls)
228228

229-
# expected failure: urls does not match format (invalide url characters)
229+
# expected failure: urls does not match format (invalid url characters)
230230
with pytest.raises(SystemExit):
231231
desc.load(invalid_urls)
232232

opencontainers/tests/test_imagelayout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_imagelayout(tmp_path):
1515
"""test creation of an opencontainers ImageLayout"""
1616
layout = ImageLayout()
1717

18-
# expected faulure: imageLayoutVersion does not match pattern or type
18+
# expected failure: imageLayoutVersion does not match pattern or type
1919
with pytest.raises(SystemExit):
2020
layout.load({"imageLayoutVersion": 1.0})
2121

setup.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
[metadata]
22
description_file = README.md
3+
4+
[codespell]
5+
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
6+
skip = .git*,*.svg,*.css,*.min.*
7+
check-hidden = true
8+
ignore-regex = \bIntStruct\b
9+
# ignore-words-list =

0 commit comments

Comments
 (0)