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/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9f7f1ca8..562a1dad 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,3 +8,9 @@ repos: files: ^pysqa/ - id: ruff-format name: ruff format + + - repo: https://github.com/codespell-project/codespell + # Configuration for codespell is in .pre-commit-config.yaml + rev: v2.4.1 + hooks: + - id: codespell diff --git a/notebooks/example_config.ipynb b/notebooks/example_config.ipynb index 9430c6aa..c63bb468 100644 --- a/notebooks/example_config.ipynb +++ b/notebooks/example_config.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "source": [ "# Python Interface Config\n", - "The `pysqa` package primarily defines one class, that is the `QueueAdapter`. It loads the configuration from a configuration directory, initializes the corrsponding adapter for the specific queuing system and provides a high level interface for users to interact with the queuing system. The `QueueAdapter` can be imported using:" + "The `pysqa` package primarily defines one class, that is the `QueueAdapter`. It loads the configuration from a configuration directory, initializes the corresponding adapter for the specific queuing system and provides a high level interface for users to interact with the queuing system. The `QueueAdapter` can be imported using:" ] }, { @@ -26,7 +26,7 @@ "cell_type": "markdown", "id": "7e3cf646-d4e7-4b1e-ab47-f07342d7a5a2", "metadata": {}, - "source": "After the initial import the class is initialized using the configuration directory specificed by the `directory` parameter which defaults to `\"~/.queues\"`. In this example we load the configuration from the `test` directory: " + "source": "After the initial import the class is initialized using the configuration directory specified by the `directory` parameter which defaults to `\"~/.queues\"`. In this example we load the configuration from the `test` directory: " }, { "cell_type": "code", diff --git a/notebooks/example_queue_type.ipynb b/notebooks/example_queue_type.ipynb index b4884ba9..bff0a89d 100644 --- a/notebooks/example_queue_type.ipynb +++ b/notebooks/example_queue_type.ipynb @@ -26,7 +26,7 @@ "cell_type": "markdown", "source": [ "# Dynamic Python Interface\n", - "The `pysqa` package primarily defines one class, that is the `QueueAdapter`. It can either load the configuration from a configuration directory, or initializes the corrsponding adapter for the specific queuing system type `queue_type` and provides a high level interface for users to interact with the queuing system. The `QueueAdapter` can be imported using:" + "The `pysqa` package primarily defines one class, that is the `QueueAdapter`. It can either load the configuration from a configuration directory, or initializes the corresponding adapter for the specific queuing system type `queue_type` and provides a high level interface for users to interact with the queuing system. The `QueueAdapter` can be imported using:" ], "metadata": {} }, @@ -44,7 +44,7 @@ { "id": "7e3cf646-d4e7-4b1e-ab47-f07342d7a5a2", "cell_type": "markdown", - "source": "After the initial import the class is initialized using the queuing system type specificed by the `queue_type` parameter. In this example we load the `flux` as queuing system interface: ", + "source": "After the initial import the class is initialized using the queuing system type specified by the `queue_type` parameter. In this example we load the `flux` as queuing system interface: ", "metadata": {} }, { diff --git a/pyproject.toml b/pyproject.toml index 3c164471..a2bfd88b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -116,4 +116,10 @@ path = "pysqa/_version.py" [tool.coverage.run] omit = ["pysqa/_version.py", "tests/*"] -command_line = "-m unittest discover tests" \ No newline at end of file +command_line = "-m unittest discover tests" +[tool.codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = '.git*' +check-hidden = true +ignore-regex = '^\s*"image/\S+": ".*' +# ignore-words-list = ''