vale
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
- Version in MegaLinter: 2.27.0
- 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_VALE
in ENABLE_LINTERS variable - Disable vale by adding
SPELL_VALE
in 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_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_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 |
MegaLinter Flavours
This linter is available in the following flavours
Flavor | Description | Embedded linters | Info | |
---|---|---|---|---|
all | Default MegaLinter Flavor | 113 | ||
documentation | MegaLinter for documentation projects | 47 | ||
dotnet | Optimized for C, C++, C# or VB based projects | 59 | ||
go | Optimized for GO based projects | 49 | ||
java | Optimized for JAVA based projects | 51 | ||
javascript | Optimized for JAVASCRIPT or TYPESCRIPT based projects | 56 | ||
php | Optimized for PHP based projects | 50 | ||
python | Optimized for PYTHON based projects | 58 | ||
ruby | Optimized for RUBY based projects | 47 | ||
rust | Optimized for RUST based projects | 47 | ||
salesforce | Optimized for Salesforce based projects | 50 | ||
swift | Optimized for SWIFT based projects | 47 | ||
terraform | Optimized for TERRAFORM based projects | 51 |
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-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-metrics Print the given file's internal metrics to stdout.
sync Download and install external configuration sources.
Installation on mega-linter Docker image
- Dockerfile commands :
FROM jdkato/vale:latest as vale
COPY --link --from=vale /bin/vale /bin/vale