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

Allow exclusion of terms in .woke.yml #245

Open
jcraigk opened this issue Nov 6, 2022 · 6 comments
Open

Allow exclusion of terms in .woke.yml #245

jcraigk opened this issue Nov 6, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@jcraigk
Copy link

jcraigk commented Nov 6, 2022

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.

@jcraigk jcraigk added the enhancement New feature or request label Nov 6, 2022
@nicorikken
Copy link
Contributor

You can also create a custom set of rules and leave out the words you think are acceptable.

@richm
Copy link

richm commented Feb 17, 2023

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"?

@nicorikken
Copy link
Contributor

@richm by setting word_boundary_start: true https://docs.getwoke.tech/rules/

@Puneethgr
Copy link

Puneethgr commented Feb 21, 2023

@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:

  1. disable some default rules (See https://docs.getwoke.tech/rules/#disabling-default-rules)
    or
  2. 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

@nicorikken
Copy link
Contributor

@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.

@Puneethgr
Copy link

Puneethgr commented Feb 22, 2023

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants