Contribute to the Vale at Red Hat project
Learn how to contribute to the Vale at Red Hat project. This guide covers the repository structure, contribution workflow, and how to extend Vale by adding new words to the spelling rule or creating custom style rules. Whether you’re fixing bugs, adding new rules, or improving documentation, this guide will help you get started.
Join us! ✨
Hello! We’re happy you’re thinking about joining our project. Every bit helps, whether you’re fixing a typographical error, suggesting an improvement, or just getting to know the community. Got questions or need help? Ask us in the Slack channel #vale-at-red-hat, in the CoreOS workspace.
There are many ways you can help:
-
Make our docs better: Use Vale to help make our documentation clearer. Check out how to set Vale up here: Installing Vale CLI.
-
Tell us what you think: Let us know if something doesn’t work right or if you have a great idea. Go here to share your thoughts: Report issues and request enhancements.
-
Chat with us: Come talk to us on Slack in our chat room #vale-at-red-hat.
-
Share your work: Do you want to contribute changes? Please share it with us by following this guide: Git forking workflow.
-
Add your touch: Interested in adding rules or styles? Learn how here: Extending Styles.
Vale at Red Hat repository
The vale-at-red-hat repository has resources to validate language in documentation projects with Vale:
-
Red Hat style for Vale in the
.vale/styles/RedHatdirectory -
AsciiDoc style in the
.vale/styles/AsciiDocdirectory -
OpenShift AsciiDoc style in the
.vale/styles/OpenShiftAsciiDocdirectory -
Vale configuration files for usage in a local environment or by the GitHub Action.
Updating the Red Hat dictionary
The Red Hat dictionary is a Hunspell-format dictionary that contains technical terms, product names, and Red Hat-specific jargon. When a word that should not get caught in the spelling filter is missing from the dictionary and is common enough to benefit all Red Hat documentation projects, you can add it to the dictionary wordlist.
Note
For project-specific terms that are unlikely to benefit other projects, use a project vocabulary instead. See Creating a vocabulary for a project.
-
Python 3.6 or later.
-
You forked and cloned the
vale-at-red-hatrepository using the Git forking workflow.
-
Open the wordlist file
.vale/styles/RedHat/dictionaries/wordlist.txtin a text editor. -
Add the new word as plain text on a new line. You do not need to sort entries, add flags, or maintain a word count.
The build script handles everything automatically:
-
Plural detection: If you add both the singular and plural forms (for example,
APIandAPIs), the build script detects the relationship and consolidates them with the appropriate Hunspell flag. -
Auto-capitalization: Lowercase words automatically get a title case counterpart in the dictionary. For example, adding
spyrealso generatesSpyre. -
Possessive forms: Capitalized words automatically get possessive forms (for example,
Dockeralso generatesDocker’s).
For proper nouns and acronyms, use the exact casing you need, such as
DockerorAWS.Lines starting with
#are treated as comments and blank lines are ignored.Example entriesAPI APIs Kubernetes spyre Docker -
-
Run the build script to regenerate the dictionary:
$ python3 tools/build-dictionary.py -
Verify the spelling rule works correctly:
$ vale --config=.vale.ini <file_containing_word> -
Add, commit, and push both
wordlist.txtanden_US-RedHat.dic. -
Request a review or help in the Slack channel #vale-at-red-hat, in the CoreOS workspace.
Updating the affix file
The affix file .vale/styles/RedHat/dictionaries/en_US-RedHat.aff defines the morphology rules that the dictionary flags reference.
In most cases, you do not need to modify this file.
The build script (tools/build-dictionary.py) generates the appropriate flags automatically based on the plural forms it detects in the wordlist.
The current affix file defines:
-
S flag: Plural suffix rules that handle standard English pluralization patterns (
-s,-es,-ies). -
P flag: Possessive suffix rules that add
'sto words not ending ins, or just'to words ending ins(for example,Kubernetes').
SET UTF-8
# Plural suffix flag
SFX S Y 4
SFX S y ies [^aeiou]y
SFX S 0 s [aeiou]y
SFX S 0 es [sxzh]
SFX S 0 s [^sxzhy]
# Possessive suffix flag
SFX P Y 2
SFX P 0 's [^s]
SFX P 0 ' [s]
Extending styles in the vale-at-red-hat repository
The vale-at-red-hat repository is an open source project maintained and developed by volunteers. If you want to contribute to the Vale at Red Hat project, feel free to open a PR.
Note
If you use a custom Vale rule set in your Red Hat project, consider adding it to the vale-at-red-hat repository.
-
You forked and cloned the
vale-at-red-hatrepository using the Git forking workflow.
-
Configure the rule in the
stylesfolder:.vale/styles/<Style>/<StyleName>.yml. -
Configure the test fixtures in the
fixturesfolder:.vale/fixtures/<Style>/<StyleName>/testinvalid.adoc|testvalid.adoc -
Run the
valecommand in the test fixtures folder to ensure that the rule triggers as you expect, for example:$ vale .Example outputtestinvalid.adoc 2:1 error Quoted ID value is not closed. AsciiDoc.ClosedIdQuotes 6:1 error Quoted ID value is not closed. AsciiDoc.ClosedIdQuotes ✖ 2 errors, 0 warnings and 0 suggestions in 2 files. -
Add, commit and push your changes.
-
Request a review or help in the Slack channel #vale-at-red-hat, in the CoreOS workspace.