Skip to content

Commit

Permalink
Replace woke with codespell
Browse files Browse the repository at this point in the history
  • Loading branch information
spetrosi committed Feb 6, 2025
1 parent 154fae6 commit 18982c1
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 26 deletions.
4 changes: 3 additions & 1 deletion inventory/group_vars/active_roles.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
present_files:
- .github/dependabot.yml
- .github/pull_request_template.md
- .codespellrc
- .commitlintrc.js
- .fmf/version
- .markdownlint.yaml
Expand All @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion inventory/host_vars/ha_cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ role_present_templates:
# to shut up
ansible_lint:
skip_list:
- sanity[cannot-ignore] # wokeignore:rule=sanity
- sanity[cannot-ignore]
2 changes: 1 addition & 1 deletion inventory/host_vars/timesync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion inventory/host_vars/vpn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ github_actions:
- cron: "8 10 * * 3"
ansible_lint:
skip_list:
- sanity[cannot-ignore] # wokeignore:rule=sanity
- sanity[cannot-ignore]
4 changes: 4 additions & 0 deletions playbooks/files/.codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]
builtin = usage
ignore-multiline-regex = codespell:ignore-begin.*codespell:ignore-end
context=0
2 changes: 1 addition & 1 deletion playbooks/templates/.ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ kinds:
{% if val %}
{{ param }}:
{% for item in val %}
- {{ item }}{% if item is search("sanity") %} # wokeignore:rule=sanity{% endif %}
- {{ item }}

{% endfor %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion playbooks/templates/.github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
32 changes: 32 additions & 0 deletions playbooks/templates/.github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -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 +%}
20 changes: 0 additions & 20 deletions playbooks/templates/.github/workflows/woke.yml

This file was deleted.

0 comments on commit 18982c1

Please sign in to comment.