Replies: 3 comments 5 replies
-
This will work: extends: substitution
message: "Consider '%s' instead of '%s'."
link: "https://stylepedia.net/style/6.0/#inclusive-language"
level: warning
ignorecase: true
action:
name: replace
swap:
- master(?! dns zone): main|primary|controller|leader
- master dns zone: primary which gives cases/test2.md
3:1 warning Consider 'main', 'primary', Test.Rule
'controller', or 'leader'
instead of 'master'.
5:1 warning Consider 'primary' instead of Test.Rule
'master dns zone'. |
Beta Was this translation helpful? Give feedback.
5 replies
-
I was unable to make this work. Perhaps it's because we have other tests for master and slave in the same style? I eventually created a separate rule to handle these use cases, and it seems to be working. Still testing. |
Beta Was this translation helpful? Give feedback.
0 replies
-
We ended up resolving this by having two rules. I think we just had too many variations to make it all work reliably in one rule. Thanks for all the tips 👍 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have a substitution rule whose main goal is to identify DEI issues (e.g., use of master, slave, sanity, etc) and offer suitable suggestions. This partly works, but we want to refine it so that we can specify particular suggestions in particular cases.
E.g., for "master dns zone" we want to suggest "primary", and not any of the other alternatives to "master" that are otherwise on offer. I've tried working with lookaheads but so far haven't been able to make it work. Right now the main part of the style looks like this:
The other issue that we're having is that if a piece of text triggers two rules, then it seems to do so inconsistently. If we run it once it might fail on one rule, and if we then run it again it might fail on a different rule. I haven't found a pattern to this.
Greatly appreciate any help.
Beta Was this translation helpful? Give feedback.
All reactions