Adding Vale to a project

Consider adding Vale configuration files to a project to:

  • Simplify Vale usage by anyone in a project

  • Use Vale in continuous integration

Prerequisites
  • Install the Vale command-line tool.

Procedure
  1. Create a .vale.ini configuration file in the root directory for your documentation project:

    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

    By default, the .vale.ini file sets MinAlertLevel = suggestion. Consider changing MinAlertLevel to warning or error for new projects.

    For a complete list of possible configuration options, see configuration options for .vale.ini.

    Review the following Red Hat project .vale.ini files as reference for developing your own Vale configuration:

    • Run the vale sync command from the repository folder to download the rules to the project directory. For example:

      $ cd __<project_directory>__
      $ vale sync
       SUCCESS  Downloaded package 'RedHat'
      Downloading packages [1/1]
Verification
  • Run the vale command on one of your content files.

    $ cd <project_directory>
    $ vale <filename>