Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Replace woke with codespell #267

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ kinds:
skip_list:
- fqcn-builtins
- var-naming[no-role-prefix]
- sanity[cannot-ignore] # wokeignore:rule=sanity
- sanity[cannot-ignore]
exclude_paths:
- tests/roles/
- .github/
Expand Down
Empty file added .codespell_ignores
Empty file.
4 changes: 4 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]
ignore-multiline-regex = codespell:ignore-begin.*codespell:ignore-end
context = 0
ignore-words = .codespell_ignores
35 changes: 34 additions & 1 deletion .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,48 @@ jobs:
pip3 install "git+https://github.com/linux-system-roles/[email protected]"

- name: Convert role to collection format
id: collection
run: |
set -euxo pipefail
TOXENV=collection lsr_ci_runtox
coll_dir=".tox/ansible_collections/$LSR_ROLE2COLL_NAMESPACE/$LSR_ROLE2COLL_NAME"
# cleanup after collection conversion
rm -rf "$coll_dir/.ansible" .tox/ansible-plugin-scan
# ansible-lint action requires a .git directory???
# https://github.com/ansible/ansible-lint/blob/main/action.yml#L45
mkdir -p "$coll_dir/.git"
meta_req_file="${{ github.workspace }}/meta/collection-requirements.yml"
test_req_file="${{ github.workspace }}/tests/collection-requirements.yml"
if [ -f "$meta_req_file" ] && [ -f "$test_req_file" ]; then
coll_req_file="${{ github.workspace }}/req.yml"
python -c 'import sys; import yaml
hsh1 = yaml.safe_load(open(sys.argv[1]))
hsh2 = yaml.safe_load(open(sys.argv[2]))
coll = {}
for item in hsh1["collections"] + hsh2["collections"]:
if isinstance(item, dict):
name = item["name"]
rec = item
else:
name = item # assume string
rec = {"name": name}
if name not in coll:
coll[name] = rec
hsh1["collections"] = list(coll.values())
yaml.safe_dump(hsh1, open(sys.argv[3], "w"))' "$meta_req_file" "$test_req_file" "$coll_req_file"
echo merged "$coll_req_file"
cat "$coll_req_file"
elif [ -f "$meta_req_file" ]; then
coll_req_file="$meta_req_file"
elif [ -f "$test_req_file" ]; then
coll_req_file="$test_req_file"
else
coll_req_file=""
fi
echo "coll_req_file=$coll_req_file" >> $GITHUB_OUTPUT

- name: Run ansible-lint
uses: ansible/ansible-lint@v24
uses: ansible/ansible-lint@v25
with:
working_directory: ${{ github.workspace }}/.tox/ansible_collections/${{ env.LSR_ROLE2COLL_NAMESPACE }}/${{ env.LSR_ROLE2COLL_NAME }}
requirements_file: ${{ steps.collection.outputs.coll_req_file }}
2 changes: 1 addition & 1 deletion .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
17 changes: 17 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -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
27 changes: 27 additions & 0 deletions .github/workflows/detect_non_inclusive_language.yml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 0 additions & 20 deletions .github/workflows/woke.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# timesync

[![ansible-lint.yml](https://github.com/linux-system-roles/timesync/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/timesync/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/timesync/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/timesync/actions/workflows/ansible-test.yml) [![markdownlint.yml](https://github.com/linux-system-roles/timesync/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/timesync/actions/workflows/markdownlint.yml) [![shellcheck.yml](https://github.com/linux-system-roles/timesync/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/linux-system-roles/timesync/actions/workflows/shellcheck.yml) [![tft.yml](https://github.com/linux-system-roles/timesync/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/timesync/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/timesync/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/timesync/actions/workflows/tft_citest_bad.yml) [![woke.yml](https://github.com/linux-system-roles/timesync/actions/workflows/woke.yml/badge.svg)](https://github.com/linux-system-roles/timesync/actions/workflows/woke.yml)
[![ansible-lint.yml](https://github.com/linux-system-roles/timesync/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/timesync/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/timesync/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/timesync/actions/workflows/ansible-test.yml) [![codespell.yml](https://github.com/linux-system-roles/timesync/actions/workflows/codespell.yml/badge.svg)](https://github.com/linux-system-roles/timesync/actions/workflows/codespell.yml) [![detect_non_inclusive_language.yml](https://github.com/linux-system-roles/timesync/actions/workflows/detect_non_inclusive_language.yml/badge.svg)](https://github.com/linux-system-roles/timesync/actions/workflows/detect_non_inclusive_language.yml) [![markdownlint.yml](https://github.com/linux-system-roles/timesync/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/timesync/actions/workflows/markdownlint.yml) [![shellcheck.yml](https://github.com/linux-system-roles/timesync/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/linux-system-roles/timesync/actions/workflows/shellcheck.yml) [![tft.yml](https://github.com/linux-system-roles/timesync/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/timesync/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/timesync/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/timesync/actions/workflows/tft_citest_bad.yml)

This role installs and configures an NTP and/or PTP implementation to operate
<!--- wokeignore:rule=slave -->

Check failure on line 6 in README.md

View workflow job for this annotation

GitHub Actions / Detect non-inclusive language

slave ==> secondary, follower, standby, replica, reader, worker, helper, subordinate, subsystem
as an NTP client and/or PTP slave in order to synchronize the system clock with

Check failure on line 7 in README.md

View workflow job for this annotation

GitHub Actions / Detect non-inclusive language

slave ==> secondary, follower, standby, replica, reader, worker, helper, subordinate, subsystem
<!--- wokeignore:rule=master -->

Check failure on line 8 in README.md

View workflow job for this annotation

GitHub Actions / Detect non-inclusive language

master ==> primary, leader, active, writer, coordinator, parent, manager, main
NTP servers and/or grandmasters in PTP domains. Supported NTP/PTP

Check failure on line 9 in README.md

View workflow job for this annotation

GitHub Actions / Detect non-inclusive language

master ==> primary, leader, active, writer, coordinator, parent, manager, main
implementations are chrony, ntp (the reference implementation) and linuxptp.

## Warning
Expand Down Expand Up @@ -65,7 +65,7 @@
- number: 0 # PTP domain number
interfaces: [eth0] # List of interfaces in the domain
delay: 0.000010 # Assumed maximum network delay to the
# grandmaster in seconds # wokeignore:rule=master

Check failure on line 68 in README.md

View workflow job for this annotation

GitHub Actions / Detect non-inclusive language

master ==> primary, leader, active, writer, coordinator, parent, manager, main

Check failure on line 68 in README.md

View workflow job for this annotation

GitHub Actions / Detect non-inclusive language

master ==> primary, leader, active, writer, coordinator, parent, manager, main
# (default 100 microsecond)
transport: UDPv4 # Network transport: UDPv4, UDPv6, L2
# (default UDPv4)
Expand Down Expand Up @@ -105,7 +105,7 @@
# are not covered by the predefined settings provided by this role.
# 'timesync_chrony_custom_settings' allows to define a list of custom settings
# for the chrony.conf file, by providing a list of settings. As an example,
# for debugging, one might need to log mesurements, statistics and tracking.

Check failure on line 108 in README.md

View workflow job for this annotation

GitHub Actions / Check for spelling errors

mesurements ==> measurements
# This information is usually stored in the /var/log/chrony directory. For
# that, one needs to define two different settings (logdir and log), as
# follows:
Expand Down Expand Up @@ -143,8 +143,8 @@
```

Install and configure linuxptp to synchronize the system clock with a
<!--- wokeignore:rule=master -->

Check failure on line 146 in README.md

View workflow job for this annotation

GitHub Actions / Detect non-inclusive language

master ==> primary, leader, active, writer, coordinator, parent, manager, main
grandmaster in PTP domain number 0, which is accessible on interface eth0:

Check failure on line 147 in README.md

View workflow job for this annotation

GitHub Actions / Detect non-inclusive language

master ==> primary, leader, active, writer, coordinator, parent, manager, main

```yaml
- name: Manage timesync in PTP domain 0, interface eth0
Expand Down
Loading