From dd966d9fc41368b4e2f522671bc2052bc4d230db Mon Sep 17 00:00:00 2001 From: Isaac To Date: Mon, 11 Nov 2024 12:32:00 -0800 Subject: [PATCH] ci: Add workflow for running codespell --- .github/workflows/codespell.yml | 25 +++++++++++++++++++++++++ pyproject.toml | 10 ++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..b2316674 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,25 @@ +# Codespell configuration is within pyproject.toml +--- +name: Codespell + +on: + push: + branches: [main] + pull_request: + branches: [main] + +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/pyproject.toml b/pyproject.toml index ec4b1fc3..8615fde5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,6 +85,13 @@ exclude_lines = [ "if TYPE_CHECKING:", ] +[tool.codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = '.git*' +check-hidden = true +# ignore-regex = '' +# ignore-words-list = '' + [tool.ruff] line-length = 88 indent-width = 4 @@ -103,7 +110,6 @@ ignore = [ "PLR6301", "S", "TID252", - # Allow access to protected members in tests "SLF001", -] \ No newline at end of file +]