diff --git a/.codespell_ignores b/.codespell_ignores new file mode 100644 index 00000000..e69de29b diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000..2bf9755e --- /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 00000000..8eadb612 --- /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/.github/workflows/detect_non_inclusive_language.yml b/.github/workflows/detect_non_inclusive_language.yml new file mode 100644 index 00000000..ae49bafd --- /dev/null +++ b/.github/workflows/detect_non_inclusive_language.yml @@ -0,0 +1,27 @@ +# Codespell configuration is within .codespellrc +--- +name: Detect non-inclusive language +on: # yamllint disable-line rule:truthy + - pull_request +permissions: + contents: read +jobs: + codespell: + name: Detect non-inclusive language + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Get variable with regex values + id: regexvar + run: | + curl -L -s -o dictionary_usage.txt https://raw.githubusercontent.com/codespell-project/codespell/refs/heads/main/codespell_lib/data/dictionary_usage.txt + regexvar=$(sed 's/->.*//g' dictionary_usage.txt | sed 's/$/|/' | tr -d '\n' | sed 's/.$//') + rm dictionary_usage.txt + echo "regex = $regexvar" >> .codespellrc + + - name: Detect non-inclusive language with codespell + uses: codespell-project/actions-codespell@v2 + with: + builtin: usage diff --git a/README.md b/README.md index 1dbe660b..3239217a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # logging -[![ansible-lint.yml](https://github.com/linux-system-roles/logging/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/logging/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/logging/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/logging/actions/workflows/ansible-test.yml) [![markdownlint.yml](https://github.com/linux-system-roles/logging/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/logging/actions/workflows/markdownlint.yml) [![tft.yml](https://github.com/linux-system-roles/logging/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/logging/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/logging/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/logging/actions/workflows/tft_citest_bad.yml) [![woke.yml](https://github.com/linux-system-roles/logging/actions/workflows/woke.yml/badge.svg)](https://github.com/linux-system-roles/logging/actions/workflows/woke.yml) +[![ansible-lint.yml](https://github.com/linux-system-roles/logging/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/logging/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/logging/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/logging/actions/workflows/ansible-test.yml) [![codespell.yml](https://github.com/linux-system-roles/logging/actions/workflows/codespell.yml/badge.svg)](https://github.com/linux-system-roles/logging/actions/workflows/codespell.yml) [![detect_non_inclusive_language.yml](https://github.com/linux-system-roles/logging/actions/workflows/detect_non_inclusive_language.yml/badge.svg)](https://github.com/linux-system-roles/logging/actions/workflows/detect_non_inclusive_language.yml) [![markdownlint.yml](https://github.com/linux-system-roles/logging/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/logging/actions/workflows/markdownlint.yml) [![tft.yml](https://github.com/linux-system-roles/logging/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/logging/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/logging/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/logging/actions/workflows/tft_citest_bad.yml) [![woke.yml](https://github.com/linux-system-roles/logging/actions/workflows/woke.yml/badge.svg)](https://github.com/linux-system-roles/logging/actions/workflows/woke.yml) ## Background