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 file specific and project specific exceptions #65

Closed
izmalk opened this issue Jul 20, 2024 · 1 comment
Closed

Add file specific and project specific exceptions #65

izmalk opened this issue Jul 20, 2024 · 1 comment

Comments

@izmalk
Copy link
Contributor

izmalk commented Jul 20, 2024

Implement a way to add project-wide and file-wide exceptions for Vale style checks.

For example:

 /home/izmalk/test/docs/izmalk/kafka-k8s-operator/docs/reference/r-statuses.md
 12:28  error    Did you really mean 'params'?   Vale.Spelling                          
 22:5   warning  Avoid the phrase 'Terminated'   Canonical.020-Cliche-words-and-phrases 

In the above output we see an error for the params which is a quote of the exact output produced by a program and a warning for the Terminated word, which is a name of a status and a correct technical term in this context.

I'd like to have a way to set project-specific and, ideally, file-specific exceptions for Vale checks.
File-specific exceptions are great for specific stuff that should not affect the whole project, like quotes of the output or status names.

@SecondSkoll
Copy link
Contributor

This can be done in a few ways now. With Vale's inbuild comment delimiters, with the .custom-wordlist.txt file in a project's repository, and also by attaching specific classes to words. This is not fully detailed yet, you need to include role definitions in your project that define specific classes:

rst_prolog = """
.. role:: woke-ignore
    :class: woke-ignore
.. role:: vale-ignore
    :class: vale-ignore
"""

Then apply these roles to specific terms within your documentation:

This is an ignored word: :vale-ignore:`foo`.

This is configured by default in Vale's configuration file so it is available for all users. There is also a specific 'woke-ignore' class that will... do the exact same thing. I need to rethink that implementation.

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

No branches or pull requests

2 participants