Skip to content

Commit

Permalink
ci: Check spelling with codespell
Browse files Browse the repository at this point in the history
* You can ignore words inline by adding a comment like `# codespell:ignore word`.
* You can ignore words by adding them to the `.codespell_ignores` file.
* You can ignore files and directories by adding them with `skip = ` to the `.codespellrc` file.

Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
  • Loading branch information
spetrosi committed Feb 12, 2025
1 parent 1b57520 commit 3c44a59
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 37 deletions.
1 change: 1 addition & 0 deletions .codespell_ignores
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
iif
8 changes: 8 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[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 = ./tests/files/client.key.nocrypt,./tests/files/client.pem
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
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# linux-system-roles/network

[![ansible-lint.yml](https://github.com/linux-system-roles/network/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/network/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/ansible-test.yml) [![codeql.yml](https://github.com/linux-system-roles/network/actions/workflows/codeql.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/codeql.yml) [![integration.yml](https://github.com/linux-system-roles/network/actions/workflows/integration.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/integration.yml) [![markdownlint.yml](https://github.com/linux-system-roles/network/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/markdownlint.yml) [![python-unit-test.yml](https://github.com/linux-system-roles/network/actions/workflows/python-unit-test.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/python-unit-test.yml) [![shellcheck.yml](https://github.com/linux-system-roles/network/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/shellcheck.yml) [![tft.yml](https://github.com/linux-system-roles/network/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/network/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/tft_citest_bad.yml) [![woke.yml](https://github.com/linux-system-roles/network/actions/workflows/woke.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/woke.yml) [![Coverage Status](https://coveralls.io/repos/github/linux-system-roles/network/badge.svg)](https://coveralls.io/github/linux-system-roles/network) [![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)
[![ansible-lint.yml](https://github.com/linux-system-roles/network/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/network/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/ansible-test.yml) [![codeql.yml](https://github.com/linux-system-roles/network/actions/workflows/codeql.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/codeql.yml) [![codespell.yml](https://github.com/linux-system-roles/network/actions/workflows/codespell.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/codespell.yml) [![integration.yml](https://github.com/linux-system-roles/network/actions/workflows/integration.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/integration.yml) [![markdownlint.yml](https://github.com/linux-system-roles/network/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/markdownlint.yml) [![python-unit-test.yml](https://github.com/linux-system-roles/network/actions/workflows/python-unit-test.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/python-unit-test.yml) [![shellcheck.yml](https://github.com/linux-system-roles/network/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/shellcheck.yml) [![tft.yml](https://github.com/linux-system-roles/network/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/network/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/tft_citest_bad.yml) [![woke.yml](https://github.com/linux-system-roles/network/actions/workflows/woke.yml/badge.svg)](https://github.com/linux-system-roles/network/actions/workflows/woke.yml) [![Coverage Status](https://coveralls.io/repos/github/linux-system-roles/network/badge.svg)](https://coveralls.io/github/linux-system-roles/network) [![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)

## Overview

Expand Down Expand Up @@ -480,7 +480,7 @@ In general these work like shell globs.

- `*`, matches zero or more of any character
- `?`, matches any single character
- `[fo]` - matches any single `f` or `o` character - also supports ranges - `[0-9]`
- `[fo]` - matches any single `f` or `o` character - also supports ranges - `[0-9]` <!-- codespell:ignore fo -->
will match any single digit character

### `path`
Expand Down Expand Up @@ -788,31 +788,31 @@ The ethtool configuration supports the following options:
coalesce:
adaptive_rx: true|false # optional
adaptive_tx: true|false # optional
pkt_rate_high: 0 # optional mininum=0 maximum=0xffffffff
pkt_rate_low: 0 # optional mininum=0 maximum=0xffffffff
rx_frames: 0 # optional mininum=0 maximum=0xffffffff
rx_frames_high: 0 # optional mininum=0 maximum=0xffffffff
rx_frames_irq: 0 # optional mininum=0 maximum=0xffffffff
rx_frames_low: 0 # optional mininum=0 maximum=0xffffffff
rx_usecs: 0 # optional mininum=0 maximum=0xffffffff
rx_usecs_high: 0 # optional mininum=0 maximum=0xffffffff
rx_usecs_irq: 0 # optional mininum=0 maximum=0xffffffff
rx_usecs_low: 0 # optional mininum=0 maximum=0xffffffff
sample_interval: 0 # optional mininum=0 maximum=0xffffffff
stats_block_usecs: 0 # optional mininum=0 maximum=0xffffffff
tx_frames: 0 # optional mininum=0 maximum=0xffffffff
tx_frames_high: 0 # optional mininum=0 maximum=0xffffffff
tx_frames_irq: 0 # optional mininum=0 maximum=0xffffffff
tx_frames_low: 0 # optional mininum=0 maximum=0xffffffff
tx_usecs: 0 # optional mininum=0 maximum=0xffffffff
tx_usecs_high: 0 # optional mininum=0 maximum=0xffffffff
tx_usecs_irq: 0 # optional mininum=0 maximum=0xffffffff
tx_usecs_low: 0 # optional mininum=0 maximum=0xffffffff
pkt_rate_high: 0 # optional minimum=0 maximum=0xffffffff
pkt_rate_low: 0 # optional minimum=0 maximum=0xffffffff
rx_frames: 0 # optional minimum=0 maximum=0xffffffff
rx_frames_high: 0 # optional minimum=0 maximum=0xffffffff
rx_frames_irq: 0 # optional minimum=0 maximum=0xffffffff
rx_frames_low: 0 # optional minimum=0 maximum=0xffffffff
rx_usecs: 0 # optional minimum=0 maximum=0xffffffff
rx_usecs_high: 0 # optional minimum=0 maximum=0xffffffff
rx_usecs_irq: 0 # optional minimum=0 maximum=0xffffffff
rx_usecs_low: 0 # optional minimum=0 maximum=0xffffffff
sample_interval: 0 # optional minimum=0 maximum=0xffffffff
stats_block_usecs: 0 # optional minimum=0 maximum=0xffffffff
tx_frames: 0 # optional minimum=0 maximum=0xffffffff
tx_frames_high: 0 # optional minimum=0 maximum=0xffffffff
tx_frames_irq: 0 # optional minimum=0 maximum=0xffffffff
tx_frames_low: 0 # optional minimum=0 maximum=0xffffffff
tx_usecs: 0 # optional minimum=0 maximum=0xffffffff
tx_usecs_high: 0 # optional minimum=0 maximum=0xffffffff
tx_usecs_irq: 0 # optional minimum=0 maximum=0xffffffff
tx_usecs_low: 0 # optional minimum=0 maximum=0xffffffff
ring:
rx: 0 # optional mininum=0 maximum=0xffffffff
rx_jumbo: 0 # optional mininum=0 maximum=0xffffffff
rx_mini: 0 # optional mininum=0 maximum=0xffffffff
tx: 0 # optional mininum=0 maximum=0xffffffff
rx: 0 # optional minimum=0 maximum=0xffffffff
rx_jumbo: 0 # optional minimum=0 maximum=0xffffffff
rx_mini: 0 # optional minimum=0 maximum=0xffffffff
tx: 0 # optional minimum=0 maximum=0xffffffff
```

### `ieee802_1x`
Expand Down Expand Up @@ -959,7 +959,7 @@ following options:

- `lacp_rate`

In `802.3ad` bonding mode, this option defines the rate in which we requst link
In `802.3ad` bonding mode, this option defines the rate in which we request link
partner to transmit LACPDU packets. The possible values are: `slow`, `fast`.

- `lp_interval`
Expand All @@ -978,7 +978,7 @@ following options:

- `num_grat_arp`

This option specify the number of peer notifications (gratuitious ARPs) to be
This option specify the number of peer notifications (gratuitous ARPs) to be
issued after a failover event. The allowed range for the value is 0 - 255.

- `packets_per_port`
Expand Down Expand Up @@ -1464,7 +1464,7 @@ role treats like RHEL, such as AlmaLinux, CentOS, OracleLinux, Rocky.
As Ansible usually works via the network, for example via SSH, there are some
limitations to be considered:

The `network` role does not support bootstraping networking configuration. One option
The `network` role does not support bootstrapping networking configuration. One option
may be
[ansible-pull](https://docs.ansible.com/ansible/latest/cli/ansible-pull.html).
Another option maybe be to initially auto-configure the host during installation (ISO
Expand Down
4 changes: 2 additions & 2 deletions library/network_connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def ValueEscape(cls, value):
return value

if any(ord(c) < ord(" ") for c in value):
# needs ansic escaping due to ANSI control caracters (newline)
# needs ansic escaping due to ANSI control characters (newline)
s = "$'"
for c in value:
if ord(c) < ord(c):
Expand Down Expand Up @@ -2194,7 +2194,7 @@ def start_transaction(self):
"""Hook before making changes"""

def finish_transaction(self):
"""Hook for after all changes where made successfuly"""
"""Hook for after all changes where made successfully"""

def rollback_transaction(self, idx, action, error):
"""Hook if configuring a profile results in an error
Expand Down
2 changes: 1 addition & 1 deletion module_utils/network_lsr/argument_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2012,7 +2012,7 @@ def _validate_post_fields(self, value, name, result):
# If there are no runtime changes, "wait" and "force_state_change" do
# not make sense
# FIXME: Maybe this restriction can be removed. Need to make sure that
# defaults for wait or force_state_change do not interfer
# defaults for wait or force_state_change do not interfere
if not state:
while "wait" in valid_fields:
valid_fields.remove("wait")
Expand Down
2 changes: 1 addition & 1 deletion module_utils/network_lsr/nm/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def _clean_up(self):
self._mainloop = None

def quit(self):
logging.debug("NM mainloop quiting")
logging.debug("NM mainloop quitting")
self._mainloop.quit()
self._clean_up()

Expand Down
2 changes: 1 addition & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ confidence=
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# disable everything first and then re-enable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
Expand Down
2 changes: 1 addition & 1 deletion scripts/print_all_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def parse_validator(validator):
if not validator.required:
comment += " optional"
if minval is not None:
comment += " mininum=" + str(minval)
comment += " minimum=" + str(minval)
if maxval:
if maxval == 0xFFFFFFFF:
maxval = hex(maxval)
Expand Down
2 changes: 1 addition & 1 deletion tests/playbooks/tests_checkpoint_cleanup.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
# This test is supposed to check that checkpoints are properly cleaned-up after
# failures in the module. This test currently uses the initscripts provider to
# mark a device as unmanaged for NM and then tries to activiate it using NM.
# mark a device as unmanaged for NM and then tries to activate it using NM.
# This failed without removing the checkpoint.
---
- name: Play for testing checkpoint cleanup
Expand Down
2 changes: 1 addition & 1 deletion tests/tasks/manage_test_interface.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
changed_when: false
- name: Set up veth as managed by NetworkManager
command: nmcli d set {{ interface }} managed true
# The varible for `network_provider` is not exists yet,
# The variable for `network_provider` is not exists yet,
# just ignore error for initscripts
ignore_errors: true # noqa ignore-errors
when: "type == 'veth' and state == 'present'"
Expand Down

0 comments on commit 3c44a59

Please sign in to comment.