Skip to content

vale

GitHub stars GitHub release (latest SemVer) GitHub last commit GitHub commit activity GitHub contributors

Vale brings your editorial style to life !

To be active within MegaLinter, you need to initialize a .vale.ini configuration file at the root of your repository.

MegaLinter analyze markdown and restructuredText files by default, you can change that using SPELL_VALE_FILE_EXTENSIONS variable.

vale documentation

vale - GitHub

Configuration in MegaLinter

Variable Description Default value
SPELL_VALE_ARGUMENTS User custom arguments to add in linter CLI call
Ex: -s --foo "bar"
SPELL_VALE_COMMAND_REMOVE_ARGUMENTS User custom arguments to remove from command line before calling the linter
Ex: -s --foo "bar"
SPELL_VALE_FILTER_REGEX_INCLUDE Custom regex including filter
Ex: (src\|lib)
Include every file
SPELL_VALE_FILTER_REGEX_EXCLUDE Custom regex excluding filter
Ex: (test\|examples)
Exclude no file
SPELL_VALE_CLI_LINT_MODE Override default CLI lint mode
- file: Calls the linter for each file
- list_of_files: Call the linter with the list of files as argument
- project: Call the linter from the root of the project
list_of_files
SPELL_VALE_FILE_EXTENSIONS Allowed file extensions. "*" matches any extension, "" matches empty extension. Empty list excludes all files
Ex: [".py", ""]
[".md", ".rst"]
SPELL_VALE_FILE_NAMES_REGEX File name regex filters. Regular expression list for filtering files by their base names using regex full match. Empty list includes all files
Ex: ["Dockerfile(-.+)?", "Jenkinsfile"]
Include every file
SPELL_VALE_PRE_COMMANDS List of bash commands to run before the linter None
SPELL_VALE_POST_COMMANDS List of bash commands to run after the linter None
SPELL_VALE_UNSECURED_ENV_VARIABLES List of env variables explicitly not filtered before calling SPELL_VALE and its pre/post commands None
SPELL_VALE_CONFIG_FILE vale configuration file nameUse LINTER_DEFAULT to let the linter find it .vale.ini
SPELL_VALE_RULES_PATH Path where to find linter configuration file Workspace folder, then MegaLinter default rules
SPELL_VALE_DISABLE_ERRORS Run linter but consider errors as warnings false
SPELL_VALE_DISABLE_ERRORS_IF_LESS_THAN Maximum number of errors allowed 0
SPELL_VALE_CLI_EXECUTABLE Override CLI executable ['vale']

IDE Integration

Use vale in your favorite IDE to catch errors before MegaLinter !

IDE Extension Name Install
Emacs flymake-vale Visit Web Site
jetbrains Vale Visit Web Site
Sublime Text SublimeLinter-contrib-vale Visit Web Site
vim dense-analysis/vale Visit Web Site
Visual Studio Code Vale Install in VSCode

MegaLinter Flavors

This linter is available in the following flavors

Flavor Description Embedded linters Info
all Default MegaLinter Flavor 122 Docker Image Size (tag) Docker Pulls
c_cpp Optimized for pure C/C++ projects 54 Docker Image Size (tag) Docker Pulls
documentation MegaLinter for documentation projects 49 Docker Image Size (tag) Docker Pulls
dotnet Optimized for C, C++, C# or VB based projects 61 Docker Image Size (tag) Docker Pulls
dotnetweb Optimized for C, C++, C# or VB based projects with JS/TS 70 Docker Image Size (tag) Docker Pulls
go Optimized for GO based projects 51 Docker Image Size (tag) Docker Pulls
java Optimized for JAVA based projects 52 Docker Image Size (tag) Docker Pulls
javascript Optimized for JAVASCRIPT or TYPESCRIPT based projects 59 Docker Image Size (tag) Docker Pulls
php Optimized for PHP based projects 54 Docker Image Size (tag) Docker Pulls
python Optimized for PYTHON based projects 62 Docker Image Size (tag) Docker Pulls
ruby Optimized for RUBY based projects 50 Docker Image Size (tag) Docker Pulls
rust Optimized for RUST based projects 50 Docker Image Size (tag) Docker Pulls
salesforce Optimized for Salesforce based projects 54 Docker Image Size (tag) Docker Pulls
swift Optimized for SWIFT based projects 50 Docker Image Size (tag) Docker Pulls
terraform Optimized for TERRAFORM based projects 54 Docker Image Size (tag) Docker Pulls

Behind the scenes

How are identified applicable files

  • Activated only if one of these files is found: .vale.ini
  • File extensions: .md, .rst

How the linting is performed

  • vale is called once with the list of files as arguments (list_of_files CLI lint mode)

Example calls

vale README.md file1.md file2.md file3.md
vale --config .vale.ini README.md file1.md file2.md file3.md

Help content

vale - A command-line linter for prose.

Usage:  vale [options] [input...]
  vale myfile.md myfile1.md mydir1
  vale --output=JSON [input...]

Vale is a syntax-aware linter for prose built with speed and extensibility in
mind. It supports Markdown, AsciiDoc, reStructuredText, HTML, and more.

To get started, you'll need a configuration file (.vale.ini):

Example:

  MinAlertLevel = suggestion

  [*]
  BasedOnStyles = Vale

See https://vale.sh for more setup information.

Flags:

 --config         A file path (--config='some/file/path/.vale.ini').
 --ext            An extension to associate with stdin (--ext=.md).
 --filter         An expression to filter rules by.
 --glob           A glob pattern (--glob='*.{md,txt}.')
 -h, --help       Print this help message.
 --ignore-syntax  Lint all files line-by-line.
 --no-exit        Don't return a nonzero exit code on errors.
 --no-global      Don't load the global configuration.
 --no-wrap        Don't wrap CLI output.
 --output         An output style ("line", "JSON", or a template file).
 -v, --version    Print the current version.

Commands:

 ls-config        Print the current configuration to stdout.
 ls-dirs          Print the default configuration directories to stdout.
 ls-metrics       Print the given file's internal metrics to stdout.
 ls-vars          Print the supported environment variables to stdout.
 sync             Download and install external configuration sources.

Installation on mega-linter Docker image

  • Dockerfile commands :
# renovate: datasource=docker depName=jdkato/vale
ARG SPELL_VALE_VERSION=v3.7.0
FROM jdkato/vale:${SPELL_VALE_VERSION} AS vale
COPY --link --from=vale /bin/vale /bin/vale