From 9a59deb820d701089d5960a96279bb2f6403ca84 Mon Sep 17 00:00:00 2001 From: Sergei Petrosian Date: Wed, 12 Feb 2025 12:30:08 +0100 Subject: [PATCH] ci: Check spelling with codespell * You can ignore words inline by adding a comment like `# codespell:ignore word`. * You can ignore words by adding them to the `.codespell_ignores` file. * You can ignore files and directories by adding them with `skip = ` to the `.codespellrc` file. Signed-off-by: Sergei Petrosian --- .codespell_ignores | 0 .codespellrc | 8 ++++++++ .github/workflows/codespell.yml | 17 +++++++++++++++++ README.md | 2 +- 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .codespell_ignores create mode 100644 .codespellrc create mode 100644 .github/workflows/codespell.yml diff --git a/.codespell_ignores b/.codespell_ignores new file mode 100644 index 0000000..e69de29 diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..2bf9755 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,8 @@ +[codespell] +check-hidden = true +# Note that `-w` doesn't work when ignore-multiline-regex is set +# https://github.com/codespell-project/codespell/issues/3642 +ignore-multiline-regex = codespell:ignore-begin.*codespell:ignore-end +ignore-words = .codespell_ignores +# skip-file is not available https://github.com/codespell-project/codespell/pull/2759 +skip = .README.html diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..8eadb61 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,17 @@ +# Codespell configuration is within .codespellrc +--- +name: Codespell +on: # yamllint disable-line rule:truthy + - pull_request +permissions: + contents: read +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Codespell + uses: codespell-project/actions-codespell@v2 diff --git a/README.md b/README.md index e5922a6..4ef4ca2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # SELinux -[![ansible-lint.yml](https://github.com/linux-system-roles/selinux/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/selinux/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/selinux/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/selinux/actions/workflows/ansible-test.yml) [![codeql.yml](https://github.com/linux-system-roles/selinux/actions/workflows/codeql.yml/badge.svg)](https://github.com/linux-system-roles/selinux/actions/workflows/codeql.yml) [![markdownlint.yml](https://github.com/linux-system-roles/selinux/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/selinux/actions/workflows/markdownlint.yml) [![python-unit-test.yml](https://github.com/linux-system-roles/selinux/actions/workflows/python-unit-test.yml/badge.svg)](https://github.com/linux-system-roles/selinux/actions/workflows/python-unit-test.yml) [![tft.yml](https://github.com/linux-system-roles/selinux/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/selinux/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/selinux/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/selinux/actions/workflows/tft_citest_bad.yml) [![woke.yml](https://github.com/linux-system-roles/selinux/actions/workflows/woke.yml/badge.svg)](https://github.com/linux-system-roles/selinux/actions/workflows/woke.yml) +[![ansible-lint.yml](https://github.com/linux-system-roles/selinux/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/selinux/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/selinux/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/selinux/actions/workflows/ansible-test.yml) [![codeql.yml](https://github.com/linux-system-roles/selinux/actions/workflows/codeql.yml/badge.svg)](https://github.com/linux-system-roles/selinux/actions/workflows/codeql.yml) [![codespell.yml](https://github.com/linux-system-roles/selinux/actions/workflows/codespell.yml/badge.svg)](https://github.com/linux-system-roles/selinux/actions/workflows/codespell.yml) [![markdownlint.yml](https://github.com/linux-system-roles/selinux/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/selinux/actions/workflows/markdownlint.yml) [![python-unit-test.yml](https://github.com/linux-system-roles/selinux/actions/workflows/python-unit-test.yml/badge.svg)](https://github.com/linux-system-roles/selinux/actions/workflows/python-unit-test.yml) [![tft.yml](https://github.com/linux-system-roles/selinux/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/selinux/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/selinux/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/selinux/actions/workflows/tft_citest_bad.yml) [![woke.yml](https://github.com/linux-system-roles/selinux/actions/workflows/woke.yml/badge.svg)](https://github.com/linux-system-roles/selinux/actions/workflows/woke.yml) ## Expected functionality