Installing the Red Hat style for Vale globally

You can install the RedHat style for Vale globally.

Some product documentation repositories, such as openshift-docs, have an existing .vale.ini file. When you run vale on content files in the repository directory, the <repository>/.vale.ini file overrides the $HOME/.vale.ini file. For more information, see Vale configuration reference.

Run vale sync in your project directory to download the Vale rules relative to that project directory.

Procedure
  1. To use Vale with the RedHat package system-wide, create the following .vale.ini configuration file in your $HOME directory.

    Example .vale.ini
    StylesPath = .vale/styles
    
    MinAlertLevel = suggestion
    
    IgnoredScopes = code, tt, img, url, a, body.id
    
    SkippedScopes = script, style, pre, figure, code, tt, blockquote, listingblock, literalblock
    
    Packages = RedHat
    
    [*.adoc]
    
    BasedOnStyles = RedHat
    
    [*.md]
    
    BasedOnStyles = RedHat
    
    # Ignore code surrounded by backticks or plus sign, parameters defaults, URLs.
    TokenIgnores = (\x60[^\n\x60]+\x60), ([^\n]+=[^\n]*), (\+[^\n]+\+), (http[^\n]+\[)
    
    # Match INI files. See: https://docs.errata.ai/vale/scoping
    [*.ini]
    
    BasedOnStyles = RedHat
    
    # Ignore code surrounded by backticks or plus sign, parameters defaults, URLs.
    TokenIgnores = (\x60[^\n\x60]+\x60), ([^\n]+=[^\n]*), (\+[^\n]+\+), (http[^\n]+\[)
    
    # Disabling rules (NO)
    RedHat.CaseSensitiveTerms = NO
    RedHat.ConfigMap = NO
    RedHat.Definitions = NO
    RedHat.Slash = NO
    RedHat.Spacing = NO
    RedHat.Spelling = NO
    RedHat.TermsSuggestions = NO
  2. Sync the RedHat package to your computer.

    $ vale sync
    Example output
    $ vale sync
     SUCCESS  Downloaded package 'RedHat'
    Downloading packages [1/1]
    To get the latest updates, run vale sync regularly.
Verification
  1. Run vale against a source file:

    $ cd <project_directory>
    $ vale <filename>
    Example output
    $ vale modules/ztp-creating-the-site-secrets.adoc
    
     modules/ztp-creating-the-site-secrets.adoc
     10:222  error       Use 'Assisted Installer'        Vale.Terms
                         instead of 'assisted
                         installer'.
     14:13   suggestion  'are referenced' is passive     RedHat.PassiveVoice
                         voice. In general, use active
                         voice. Consult the style guide
                         for acceptable use of passive
                         voice.
    
    ✖ 2 errors, 0 warnings and 1 suggestion in 1 file.