diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..12f226a --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,25 @@ +# Codespell configuration is within setup.cfg +--- +name: Codespell + +on: + push: + branches: [master] + pull_request: + branches: [master] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Annotate locations with typos + uses: codespell-project/codespell-problem-matcher@v1 + - name: Codespell + uses: codespell-project/actions-codespell@v2 diff --git a/docs/_docs/getting-started.md b/docs/_docs/getting-started.md index 899ebc2..7b0897b 100644 --- a/docs/_docs/getting-started.md +++ b/docs/_docs/getting-started.md @@ -361,7 +361,7 @@ req = (client.NewRequest("PATCH", response.GetRelativeLocation()). blobResponse = client.Do(req) ``` -Finally, valiate the uploaded blob content. +Finally, validate the uploaded blob content. ```python req = client.NewRequest("GET", "/v2//blobs/", diff --git a/opencontainers/digest/digest.py b/opencontainers/digest/digest.py index 41048c2..ac15394 100644 --- a/opencontainers/digest/digest.py +++ b/opencontainers/digest/digest.py @@ -56,7 +56,7 @@ def sepIndex(self): Return the index of the : separator. return the index of the : separator or the index - that separtes the extra content provided in the algorithm name. + that separates the extra content provided in the algorithm name. """ try: algorithm, encoded = (self).split(":") diff --git a/opencontainers/distribution/reggie/client.py b/opencontainers/distribution/reggie/client.py index b59791f..1aac358 100644 --- a/opencontainers/distribution/reggie/client.py +++ b/opencontainers/distribution/reggie/client.py @@ -175,7 +175,7 @@ def NewRequest(self, method, path, *opts): # Set default namespace, and fill in string replacements namespace = rc.Name or self.Config.DefaultName - # Substitute known path paramaters + # Substitute known path parameters replacements = { "": namespace, "": rc.Reference, @@ -199,7 +199,7 @@ def NewRequest(self, method, path, *opts): def Do(self, req): """ - Execut a request. + Execute a request. Given a request (an instance of the RequestClient, execute the request and return a response. diff --git a/opencontainers/tests/test_descriptor.py b/opencontainers/tests/test_descriptor.py index 07b3a1b..cccb5e7 100644 --- a/opencontainers/tests/test_descriptor.py +++ b/opencontainers/tests/test_descriptor.py @@ -215,7 +215,7 @@ def test_descriptor(tmp_path): with pytest.raises(ErrDigestInvalidFormat): desc.load(no_hash) - # expected failure: digest does not match pattern (invalid aglorithm characters) + # expected failure: digest does not match pattern (invalid algorithm characters) with pytest.raises(ErrDigestInvalidFormat): desc.load(invalid_algchars) @@ -226,7 +226,7 @@ def test_descriptor(tmp_path): # expected success: valid URL entry desc.load(valid_urls) - # expected failure: urls does not match format (invalide url characters) + # expected failure: urls does not match format (invalid url characters) with pytest.raises(SystemExit): desc.load(invalid_urls) diff --git a/opencontainers/tests/test_imagelayout.py b/opencontainers/tests/test_imagelayout.py index 7b31055..813ac21 100644 --- a/opencontainers/tests/test_imagelayout.py +++ b/opencontainers/tests/test_imagelayout.py @@ -15,7 +15,7 @@ def test_imagelayout(tmp_path): """test creation of an opencontainers ImageLayout""" layout = ImageLayout() - # expected faulure: imageLayoutVersion does not match pattern or type + # expected failure: imageLayoutVersion does not match pattern or type with pytest.raises(SystemExit): layout.load({"imageLayoutVersion": 1.0}) diff --git a/setup.cfg b/setup.cfg index 08aedd7..e45c379 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,9 @@ [metadata] description_file = README.md + +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = .git*,*.svg,*.css,*.min.* +check-hidden = true +ignore-regex = \bIntStruct\b +# ignore-words-list =