Automate Style Checks
Tara N. English-Sweeney
Fintech Technical Writing Team Lead | Champion of Clear Communication and Customer Engagement
Vale is a tool that brings code-like linting to text. You can run the tool on a file and it shows validation errors based on designated Style Guides.
This article describes how to install and configure Vale
Note: Grazie Professional is IntelliJ's plugin that supports a growing subset of Vale's functionality. The reason this author chose to use Vale instead of Grazie is because our team uses several IDEs.
Install, configure, and test Vale locally
Prerequisite: You must have AsciiDoctor installed.
Install Vale
Configure Vale
Note:?Update BasedOnStyles to include the styles that you downloaded in step 1.
# Core setting StylesPath = styles # The (suggestion, warning, or error). # # CI builds will only fail on error-level alerts. MinAlertLevel = suggestion # MinAlertLevel = warning # Define the exceptions to use in *all* `BasedOnStyles`. Vocab = Docs [*.md] BasedOnStyles = Google, Vale, proselint TokenIgnores = (\[.*?\].*?\[\/\w+\])? ?# ignore shortcodes [*.adoc] BasedOnStyles = Google, Vale, proselint TokenIgnores = (\[.*?\].*?\[\/\w+\])? ?# ignore shortcodess
Test Vale
To test Vale in Terminal, go to a directory with an AsciiDoctor (.adoc) file and run:
vale <filename>
If you get results similar to the following, your configuration is correct:
Configure IntelliJ
1. Install the Awesome Console.
2. Go to IntelliJ IDEA > Preferences > Tools > External Tools.
3. Add Vale and enter the following for Arguments:
领英推荐
--config /Users/<your user directory>/.vale.ini --output line --sort --relative $FilePathRelativeToProjectRoot$
4. Enter the following for Working directory:
$ProjectFileDir$
5. Click OK.
6. Click Apply and OK.
4. Type the shortcut on your keyboard and click OK.
Define an icon
Open any file and use your keyboard shortcut, toolbar icon, or go to Tools > External Tools > Vale. The results are shown in the Run window.
Although you can modify the existing styles, if you pull an existing Style Guide to get the latest content, your changes might be overwritten. Therefore, I recommend that you create custom styles if needed.