woke
woke copied to clipboard
Allow exclusion of terms in `.woke.yml`
There does not appear to be a way to exclude terms that a project may use heavily due to the content it serves. For example, a codebase that deals with historical subject matter may include the term "slave" in direct reference to slavery itself, in a respectful way. Or another example: a project that includes references to works of art with sensitive terms in the art/music titles. It would be nice to have a way of specifically ignoring all mentions of these terms without having to add inline comments or ignore entire files/paths in .wokeignore
. I do not see a way of doing that in .woke.yml
either. Adding a directive like allowed_terms
in .woke.yml
would be useful.
You can also create a custom set of rules and leave out the words you think are acceptable.
You can also create a custom set of rules and leave out the words you think are acceptable.
How do you do that? How can I create a rule e.g. to reject "master" but allow "ControlMaster"?
@richm by setting word_boundary_start: true
https://docs.getwoke.tech/rules/
@jcraigk With reference to the main question, the answer is already present in the documentation: https://docs.getwoke.tech/rules/#disabling-default-rules.
All the default rules can be found in https://github.com/get-woke/woke/blob/main/pkg/rule/default.yaml
You can either:
- disable some default rules (See https://docs.getwoke.tech/rules/#disabling-default-rules) or
- disable all default rules and create your own yaml file with custom rules
Example:
woke hello.txt --disable-default-rules --config example.yaml
Reference: a. https://docs.getwoke.tech/rules/#disable-all-default-rules b. https://github.com/get-woke/woke/blob/main/example.yaml
@Puneethgr thanks for the more elaborate writeup.
The word_boundary_start: true
option actually does work for the distinction between "master" and "ControlMaster" as the latter doesn't have a word boundary before "Master". If you for example would encounter "MasterController", then it would match and trigger an error.
@nicorikken Oh yes, correct. My answer was for jcraigk's main question.
How can I create a rule e.g. to reject "master" but allow "ControlMaster"?
Your answer was for richm's comment question. I didn't see that.
Cool. Updated my older comment.