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

Add check for non-inclusive language #64

Merged
merged 2 commits into from
Dec 22, 2022

Conversation

nhosoi
Copy link
Contributor

@nhosoi nhosoi commented Dec 21, 2022

Add a check for usage of terms and language that is considered
non-inclusive. We are using the woke tool for this with a wordlist
that can be found at
https://github.com/linux-system-roles/tox-lsr/blob/main/src/tox_lsr/config_files/woke.yml

README.md - cleanup non-inclusive words.

README.md Outdated
@@ -39,8 +39,8 @@ clean postfix installation.

**WARNING**: If you specify `previous: replaced`, the role reinstalls the postfix
package and replaces the existing `/etc/postfix/main.cf` and
`/etc/postix/master.cf` files. Ensure to back up those files to preserve your
settings.
`/etc/postix/master.cf` files. <!--- wokeignore:rule=master -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo here (was here previously) - should be /etc/postfix/master.cf - please fix that too

Add a check for usage of terms and language that is considered
non-inclusive. We are using the woke tool for this with a wordlist
that can be found at
https://github.com/linux-system-roles/tox-lsr/blob/main/src/tox_lsr/config_files/woke.yml

Signed-off-by: Noriko Hosoi <[email protected]>
@@ -39,8 +39,8 @@ clean postfix installation.

**WARNING**: If you specify `previous: replaced`, the role reinstalls the postfix
package and replaces the existing `/etc/postfix/main.cf` and
`/etc/postix/master.cf` files. Ensure to back up those files to preserve your
settings.
`/etc/postfix/master.cf` files. <!--- wokeignore:rule=master -->
Copy link
Contributor

@richm richm Dec 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nhosoi do you know if there is a way to have an "allow" rule in woke.yml? For example, it would be good to be able to specify something like

- term: /etc/postfix/master.cf
  severity: allow
- term: master
  severity: error

that is, if woke found the string /etc/postfix/master.cf in any file, it would be allowed, no warnings. But other instances of the string master would be flagged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

severity takes the value info, as well. But it's also "counted" and reported as a failure in the woke.yml action unless we apply this patch get-woke/woke#252... (;_;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plus, if both master and /etc/postfix/master.cf is defined in the rule, it seems both matches.

Rule example:

rules:
  - name: master.cf
    terms:
      - master.cf
    alternatives:
      - master.cf
    severity: info

  - name: master
    terms:
      - master
    alternatives:
      - primary
      - source
      - initiator,requester
      - controller,host
      - director
    severity: warning

Woke result.

README.md:42:13-22: `master.cf` may be insensitive, use `master.cf` instead (info)
`/etc/postix/master.cf` files. Ensure to back up those files to preserve your
             ^
README.md:42:13-19: `master` may be insensitive, use `primary`, `source`, `initiator,requester`, `controller,host`, `director` instead (warning)
`/etc/postix/master.cf` files. Ensure to back up those files to preserve your
             ^

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add another value allow to severity which completely skips the check???

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add another value allow to severity which completely skips the check???

Something to consider for a future version of woke, but for now, this is ok.

@richm richm merged commit 298a0da into linux-system-roles:master Dec 22, 2022
richm added a commit to richm/linux-system-roles-postfix that referenced this pull request Jan 20, 2023
[1.3.2] - 2023-01-20
--------------------

### New Features

- none

### Bug Fixes

- ansible-lint 6.x fixes (linux-system-roles#65)

### Other Changes

- Add check for non-inclusive language (linux-system-roles#64)
- cleanup non-inclusive words.

Signed-off-by: Rich Megginson <[email protected]>
richm added a commit that referenced this pull request Jan 20, 2023
[1.3.2] - 2023-01-20
--------------------

### New Features

- none

### Bug Fixes

- ansible-lint 6.x fixes (#65)

### Other Changes

- Add check for non-inclusive language (#64)
- cleanup non-inclusive words.

Signed-off-by: Rich Megginson <[email protected]>

Signed-off-by: Rich Megginson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants