From f37ee40860cce706f505d48df7daaa79f779c754 Mon Sep 17 00:00:00 2001 From: Sergei Petrosian Date: Fri, 24 Jan 2025 14:14:47 +0100 Subject: [PATCH] ci: Replace woke with codespell woke has been left with Noriko's and all other PRs not being reviewed for years, hence we have been using our fork. https://github.com/get-woke/woke/pull/252 woke has a limitation that doesn't allow ignoring lines of code, codespell allows for this. Replacing woke with codespell that provides a dictionary for replacing phrasing with recommended terms: https://github.com/codespell-project/codespell/blob/main/codespell_lib/data/dictionary_usage.txt It also supports using custom dictionaries so we can add to the list if we want For more information about inclusive naming initiative, see https://inclusivenaming.org/about/ Codespell also checks spelling, which is an advantage for system roles because a big part of our code is user-facing - task names, debug messages, readmes. `ignore-multiline-regex` in the `.codespellrc` config allows for disabling codespell for a block of lines: ``` # codespell:ignore-begin ... codespell will not look at this text. # codespell:ignore-end ``` Signed-off-by: Sergei Petrosian --- .codespellrc | 5 +++++ .github/workflows/ansible-test.yml | 2 +- .github/workflows/codespell.yml | 18 ++++++++++++++++++ .github/workflows/woke.yml | 20 -------------------- README.md | 2 +- 5 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 .codespellrc create mode 100644 .github/workflows/codespell.yml delete mode 100644 .github/workflows/woke.yml diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..8fab288 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,5 @@ +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = tests,artifacts*,pylintrc +builtin = usage +ignore-multiline-regex = codespell:ignore-begin.*codespell:ignore-end diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml index 4dbdaa2..c9868a2 100644 --- a/.github/workflows/ansible-test.yml +++ b/.github/workflows/ansible-test.yml @@ -43,6 +43,6 @@ jobs: - name: Run ansible-test uses: ansible-community/ansible-test-gh-action@release/v1 with: - testing-type: sanity # wokeignore:rule=sanity + testing-type: sanity ansible-core-version: stable-2.17 collection-src-directory: ${{ github.workspace }}/.tox/ansible_collections/${{ env.LSR_ROLE2COLL_NAMESPACE }}/${{ env.LSR_ROLE2COLL_NAME }} diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..e1251d6 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,18 @@ +# 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: Annotate locations with typos + uses: codespell-project/codespell-problem-matcher@v1 + - name: Codespell + uses: codespell-project/actions-codespell@v2 diff --git a/.github/workflows/woke.yml b/.github/workflows/woke.yml deleted file mode 100644 index 4cded0d..0000000 --- a/.github/workflows/woke.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -# yamllint disable rule:line-length -name: Woke -on: # yamllint disable-line rule:truthy - - pull_request -jobs: - woke: - name: Detect non-inclusive language - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Run lsr-woke-action - # Originally, uses: get-woke/woke-action@v0 - uses: linux-system-roles/lsr-woke-action@main - with: - woke-args: "-c https://raw.githubusercontent.com/linux-system-roles/tox-lsr/main/src/tox_lsr/config_files/woke.yml --count-only-error-for-failure" - # Cause the check to fail on any broke rules - fail-on-error: true diff --git a/README.md b/README.md index 7203ef2..38151c7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # bootloader -[![ansible-lint.yml](https://github.com/linux-system-roles/bootloader/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/bootloader/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/bootloader/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/bootloader/actions/workflows/ansible-test.yml) [![codeql.yml](https://github.com/linux-system-roles/bootloader/actions/workflows/codeql.yml/badge.svg)](https://github.com/linux-system-roles/bootloader/actions/workflows/codeql.yml) [![markdownlint.yml](https://github.com/linux-system-roles/bootloader/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/bootloader/actions/workflows/markdownlint.yml) [![python-unit-test.yml](https://github.com/linux-system-roles/bootloader/actions/workflows/python-unit-test.yml/badge.svg)](https://github.com/linux-system-roles/bootloader/actions/workflows/python-unit-test.yml) [![tft.yml](https://github.com/linux-system-roles/bootloader/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/bootloader/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/bootloader/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/bootloader/actions/workflows/tft_citest_bad.yml) [![woke.yml](https://github.com/linux-system-roles/bootloader/actions/workflows/woke.yml/badge.svg)](https://github.com/linux-system-roles/bootloader/actions/workflows/woke.yml) +[![ansible-lint.yml](https://github.com/linux-system-roles/bootloader/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/bootloader/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/bootloader/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/bootloader/actions/workflows/ansible-test.yml) [![codeql.yml](https://github.com/linux-system-roles/bootloader/actions/workflows/codeql.yml/badge.svg)](https://github.com/linux-system-roles/bootloader/actions/workflows/codeql.yml) [![codespell.yml](https://github.com/linux-system-roles/bootloader/actions/workflows/codespell.yml/badge.svg)](https://github.com/linux-system-roles/bootloader/actions/workflows/codespell.yml) [![markdownlint.yml](https://github.com/linux-system-roles/bootloader/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/bootloader/actions/workflows/markdownlint.yml) [![python-unit-test.yml](https://github.com/linux-system-roles/bootloader/actions/workflows/python-unit-test.yml/badge.svg)](https://github.com/linux-system-roles/bootloader/actions/workflows/python-unit-test.yml) [![tft.yml](https://github.com/linux-system-roles/bootloader/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/bootloader/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/bootloader/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/bootloader/actions/workflows/tft_citest_bad.yml) An Ansible role for bootloader and kernel command line management.