vale
Vale is a command-line tool that brings your editorial style guide to life, helping maintain consistent writing quality across documentation, marketing content, and technical writing.
Key Features:
- Privacy-First: Runs entirely offline with no server-side processing - your content never leaves your machine
- Multi-Format Support: Understands markup and code, working seamlessly with Markdown, reStructuredText, HTML, and more
- Extensive Rule Library: Pre-built implementations of popular style guides (Microsoft, Google, write-good, and many others)
- Custom Rule Creation: Powerful rule engine allows you to create and share custom style rules tailored to your organization
- Industry-Tested: Trusted by thousands of writers, editors, and developers worldwide across different industries
Beyond the built-in style guides, the community maintains additional Vale packages for specialized use cases such as inclusive language and speciesist language checks. These can be installed via vale sync and added to your .vale.ini.
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
- Version in MegaLinter: 3.13.1
- Visit Official Web Site
- See How to configure vale rules
- See How to disable vale rules in files
- See Index of problems detected by vale
Configuration in MegaLinter
- Enable vale by adding
SPELL_VALEin ENABLE_LINTERS variable - Disable vale by adding
SPELL_VALEin DISABLE_LINTERS variable
| 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 filesEx: [".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 name Use 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 | |
| Sublime Text | SublimeLinter-contrib-vale | Visit Web Site | |
| vim | dense-analysis/vale | Visit Web Site | |
| Visual Studio Code | Vale | ![]() |
MegaLinter Flavors
This linter is available in the following flavors
| Flavor | Description | Embedded linters | Info | |
|---|---|---|---|---|
![]() |
all | Default MegaLinter Flavor | 134 | |
| c_cpp | Optimized for pure C/C++ projects | 58 | ||
| documentation | MegaLinter for documentation projects | 51 | ||
| dotnet | Optimized for C, C++, C# or VB based projects | 66 | ||
| dotnetweb | Optimized for C, C++, C# or VB based projects with JS/TS | 75 | ||
| go | Optimized for GO based projects | 53 | ||
| java | Optimized for JAVA based projects | 56 | ||
| javascript | Optimized for JAVASCRIPT or TYPESCRIPT based projects | 61 | ||
| php | Optimized for PHP based projects | 56 | ||
| python | Optimized for PYTHON based projects | 68 | ||
| ruby | Optimized for RUBY based projects | 52 | ||
| rust | Optimized for RUST based projects | 52 | ||
| salesforce | Optimized for Salesforce based projects | 58 | ||
| swift | Optimized for SWIFT based projects | 52 | ||
| terraform | Optimized for TERRAFORM based projects | 56 |
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_filesCLI 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.
--minAlertLevel The minimum level to display (--minAlertLevel=error).
--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.13.1
FROM jdkato/vale:${SPELL_VALE_VERSION} AS vale
COPY --link --from=vale /bin/vale /bin/vale

