Skip to content

Commit

Permalink
Remove detect-non-inclusive-language action
Browse files Browse the repository at this point in the history
  • Loading branch information
spetrosi committed Feb 12, 2025
1 parent 18982c1 commit fc55374
Show file tree
Hide file tree
Showing 17 changed files with 80 additions and 37 deletions.
4 changes: 2 additions & 2 deletions inventory/group_vars/active_roles.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
present_files:
- .github/dependabot.yml
- .github/pull_request_template.md
- .codespellrc
- .commitlintrc.js
- .fmf/version
- .markdownlint.yaml
Expand All @@ -11,6 +10,7 @@ present_files:
- README-ostree.md
present_templates:
- .ansible-lint
- .codespellrc
- .yamllint.yml
- contributing.md
- .github/workflows/ansible-lint.yml
Expand All @@ -25,6 +25,7 @@ present_templates:
- .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 @@ -40,7 +41,6 @@ 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
4 changes: 4 additions & 0 deletions inventory/host_vars/aide.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github_actions:
weekly_ci:
schedule:
- cron: "0 11 * * 6"
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]
- sanity[cannot-ignore] # wokeignore:rule=sanity
2 changes: 2 additions & 0 deletions inventory/host_vars/metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ ansible_lint:
- performancecopilot.metrics.repository
- performancecopilot.metrics.spark
markdownlint_args: "--ignore=vendor --ignore=tests/roles"
codespell_skip:
- vendor
3 changes: 3 additions & 0 deletions inventory/host_vars/network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ present_badges:
- "[![Code Style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)"
- "[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/linux-system-roles/network.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/linux-system-roles/network/context:python)"
lsr_rh_distros_extra: [OracleLinux]
codespell_skip:
- ./tests/files/client.key.nocrypt
- ./tests/files/client.pem
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]
- sanity[cannot-ignore] # wokeignore:rule=sanity
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]
- sanity[cannot-ignore] # wokeignore:rule=sanity
4 changes: 0 additions & 4 deletions playbooks/files/.codespellrc

This file was deleted.

2 changes: 1 addition & 1 deletion playbooks/files/.pandoc_template.html5
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Copyright (c) 2017 GitHub Inc.

"GitHub Pandoc HTML5 Template" is Copyright (c) Tristano Ajmone, 2017-2020,
released under the MIT License (MIT); it contains readaptations of substantial
portions of the following third party softwares:
portions of the following third party software:

(1) "GitHub Markdown CSS", Copyright (c) Sindre Sorhus, MIT License (MIT).
(2) "Primer CSS", Copyright (c) 2016 GitHub Inc., MIT License (MIT).
Expand Down
2 changes: 1 addition & 1 deletion playbooks/include_files/storage_contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ imports are located at `module_utils/storage_lsr`.
### Defaults

This is where we define the structure of the vars available to users to specify
how they want the storage to be layed out. There are two top-level lists:
how they want the storage to be laid out. There are two top-level lists:
`storage_pools` is a list of pools, which contain volumes, and
`storage_volumes`, which are volumes that are not associated with any pool.
Examples of pools include LVM volume groups and disks with partition tables.
Expand Down
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 }}
- {{ item }}{% if item is search("sanity") %} # wokeignore:rule=sanity{% endif %}

{% endfor %}
{% endif %}
Expand Down
13 changes: 13 additions & 0 deletions playbooks/templates/.codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[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
{%- if codespell_skip is defined -%}
{%- for item in (codespell_skip | d([])) -%}
,{{ item }}
{%- endfor -%}
{%- endif +%}
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
testing-type: sanity # wokeignore:rule=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
17 changes: 1 addition & 16 deletions playbooks/templates/.github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,5 @@ jobs:
- 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 +%}
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion playbooks/templates/.github/workflows/tft_citest_bad.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
RUN_ID=$(gh api "repos/$REPO/actions/workflows/tft.yml/runs?event=issue_comment" \
| jq -r "[.workflow_runs[] | select( .display_title == \"$PR_TITLE\" ) | select( .conclusion == \"failure\" ) | .id][0]")
if [ "$RUN_ID" = "null" ]; then
echo "Failed workflow not found, exitting"
echo "Failed workflow not found, exiting"
exit 1
fi
echo "Re-running workflow $RUN_ID"
Expand Down
20 changes: 20 additions & 0 deletions playbooks/templates/.github/workflows/woke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# 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
34 changes: 27 additions & 7 deletions playbooks/update_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,20 @@
loop: "{{ present_files + __present_python_files +
__present_shellcheck_files }}"

- name: Process files to be removed
shell:
chdir: "{{ git_dir }}"
cmd: |
set -euo pipefail
if [ ! -f {{ item }} ]; then
echo WARNING: file to be deleted was not found: {{ item }}
else
git rm -f {{ item }}
fi
register: git_rm
changed_when: "'rm ' in git_rm.stdout"
loop: "{{ __all_absent }}"

# NOTE: Some of the templates are github action definitions
# which use ${{ var }} - you may have to put {%- raw %}
# {%- endraw +%} blocks around them.
Expand Down Expand Up @@ -294,6 +308,19 @@
path: "{{ 'vars/main.yml' if __vars_main.stat.exists
else 'defaults/main.yml' }}"

- name: Create an empty .codespell_ignores file if it doesn't exist
shell:
chdir: "{{ git_dir }}"
cmd: |
set -euo pipefail
if [ ! -f .codespell_ignores ]; then
touch .codespell_ignores
git add .codespell_ignores
echo Success
fi
register: codespell_ignores
changed_when: "'Success' in codespell_ignores.stdout"

- name: Create git commit, PR
changed_when: false
shell:
Expand All @@ -305,13 +332,6 @@
git add "$file"
done
git add README.md
for file in {{ __all_absent | join(" ") }}; do
if [ ! -f "$file" ]; then
echo WARNING: file to be deleted was not found: "$file"
else
git rm -f "$file"
fi
done
if git diff --cached --quiet; then
# nothing to do
echo No updates for role {{ inventory_hostname }}
Expand Down

0 comments on commit fc55374

Please sign in to comment.