diff --git a/inventory/group_vars/active_roles.yml b/inventory/group_vars/active_roles.yml index 6eb327c..f03f240 100644 --- a/inventory/group_vars/active_roles.yml +++ b/inventory/group_vars/active_roles.yml @@ -1,6 +1,7 @@ present_files: - .github/dependabot.yml - .github/pull_request_template.md + - .codespellrc - .commitlintrc.js - .fmf/version - .markdownlint.yaml @@ -17,13 +18,13 @@ present_templates: - .github/workflows/ansible-test.yml - .github/workflows/build_docs.yml - .github/workflows/changelog_to_tag.yml + - .github/workflows/codespell.yml - .github/workflows/markdownlint.yml - .github/workflows/pr-title-lint.yml - .github/workflows/test_converting_readme.yml - .github/workflows/tft.yml - .github/workflows/tft_citest_bad.yml - .github/workflows/weekly_ci.yml - - .github/workflows/woke.yml - README-ansible.md - tests/vars/rh_distros_vars.yml absent_files: @@ -39,6 +40,7 @@ absent_files: - .github/actions/custom-woke-action/testdata/bad.txt - .github/actions/custom-woke-action - .github/actions + - .github/workflows/woke.yml - plans/README-plans.md - plans/general.fmf - plans diff --git a/inventory/host_vars/ha_cluster.yml b/inventory/host_vars/ha_cluster.yml index 8cb222e..31b9b45 100644 --- a/inventory/host_vars/ha_cluster.yml +++ b/inventory/host_vars/ha_cluster.yml @@ -13,4 +13,4 @@ role_present_templates: # to shut up ansible_lint: skip_list: - - sanity[cannot-ignore] # wokeignore:rule=sanity + - sanity[cannot-ignore] diff --git a/inventory/host_vars/timesync.yml b/inventory/host_vars/timesync.yml index 98ac661..75f597c 100644 --- a/inventory/host_vars/timesync.yml +++ b/inventory/host_vars/timesync.yml @@ -7,6 +7,6 @@ github_actions: # ignores ansible_lint: skip_list: - - sanity[cannot-ignore] # wokeignore:rule=sanity + - sanity[cannot-ignore] extra_vars: targets: target_hosts diff --git a/inventory/host_vars/vpn.yml b/inventory/host_vars/vpn.yml index 79286ff..1a59b6d 100644 --- a/inventory/host_vars/vpn.yml +++ b/inventory/host_vars/vpn.yml @@ -7,4 +7,4 @@ github_actions: - cron: "8 10 * * 3" ansible_lint: skip_list: - - sanity[cannot-ignore] # wokeignore:rule=sanity + - sanity[cannot-ignore] diff --git a/playbooks/files/.codespellrc b/playbooks/files/.codespellrc new file mode 100644 index 0000000..f7c80cf --- /dev/null +++ b/playbooks/files/.codespellrc @@ -0,0 +1,4 @@ +[codespell] +builtin = usage +ignore-multiline-regex = codespell:ignore-begin.*codespell:ignore-end +context=0 diff --git a/playbooks/templates/.ansible-lint b/playbooks/templates/.ansible-lint index f3e3de1..789dacd 100644 --- a/playbooks/templates/.ansible-lint +++ b/playbooks/templates/.ansible-lint @@ -30,7 +30,7 @@ kinds: {% if val %} {{ param }}: {% for item in val %} - - {{ item }}{% if item is search("sanity") %} # wokeignore:rule=sanity{% endif %} + - {{ item }}{% if item is search("sanity") %}{% endif %} {% endfor %} {% endif %} diff --git a/playbooks/templates/.github/workflows/ansible-test.yml b/playbooks/templates/.github/workflows/ansible-test.yml index 64ac87f..baa479a 100644 --- a/playbooks/templates/.github/workflows/ansible-test.yml +++ b/playbooks/templates/.github/workflows/ansible-test.yml @@ -43,7 +43,7 @@ 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 {%- raw %} collection-src-directory: ${{ github.workspace }}/.tox/ansible_collections/${{ env.LSR_ROLE2COLL_NAMESPACE }}/${{ env.LSR_ROLE2COLL_NAME }} diff --git a/playbooks/templates/.github/workflows/codespell.yml b/playbooks/templates/.github/workflows/codespell.yml new file mode 100644 index 0000000..c3d4f6c --- /dev/null +++ b/playbooks/templates/.github/workflows/codespell.yml @@ -0,0 +1,32 @@ +# 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: {{ gha_checkout_action }} + + - 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 "regexvar=$regexvar" >> "$GITHUB_OUTPUT" + + - name: Show errors from codespell as annotation in GitHub Actions + uses: codespell-project/codespell-problem-matcher@v1 + +{%- raw %} + - name: Codespell + uses: spetrosi/actions-codespell@add-regex-input + with: + regex: ${{ steps.regexvar.outputs.regexvar }} +{%- endraw +%} diff --git a/playbooks/templates/.github/workflows/woke.yml b/playbooks/templates/.github/workflows/woke.yml deleted file mode 100644 index 126d31e..0000000 --- a/playbooks/templates/.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: {{ gha_checkout_action }} - - - 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