Skip to content

v8r

v8r checks the validity of JSON/YAML files if they have a matching schema defined on schemastore.org

v8r documentation

v8r - GitHub

Configuration in Mega-Linter

Variable Description Default value
YAML_V8R_ARGUMENTS User custom arguments to add in linter CLI call
Ex: -s --foo "bar"
YAML_V8R_FILTER_REGEX_INCLUDE Custom regex including filter
Ex: (src|lib)
Include every file
YAML_V8R_FILTER_REGEX_EXCLUDE Custom regex excluding filter
Ex: (test|examples)
Exclude no file
YAML_V8R_FILE_EXTENSIONS Allowed file extensions. "*" matches any extension, "" matches empty extension. Empty list excludes all files
Ex: [".py", ""]
[".yml", ".yaml"]
YAML_V8R_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
YAML_V8R_DISABLE_ERRORS Run linter but consider errors as warnings false
YAML_V8R_DISABLE_ERRORS_IF_LESS_THAN Maximum number of errors allowed 0

IDE Integration

Use v8r in your favorite IDE to catch errors before Mega-Linter !

IDE Extension Name Install
Eclipse native support Visit Web Site
IDEA native support Visit Web Site
vim vison Visit Web Site
Visual Studio Code native support Visit Web Site

Mega-Linter Flavours

This linter is available in the following flavours

Flavor Description Embedded linters Info
all Default Mega-Linter Flavor 84 Docker Image Size (tag) Docker Pulls
ci_light Optimized for CI items (Dockerfile, Jenkinsfile, JSON/YAML schemas,XML 12 Docker Image Size (tag) Docker Pulls
dart Optimized for DART based projects 38 Docker Image Size (tag) Docker Pulls
documentation Mega-Linter for documentation projects 37 Docker Image Size (tag) Docker Pulls
dotnet Optimized for C, C++, C# or VB based projects 43 Docker Image Size (tag) Docker Pulls
go Optimized for GO based projects 39 Docker Image Size (tag) Docker Pulls
java Optimized for JAVA based projects 38 Docker Image Size (tag) Docker Pulls
javascript Optimized for JAVASCRIPT or TYPESCRIPT based projects 46 Docker Image Size (tag) Docker Pulls
php Optimized for PHP based projects 41 Docker Image Size (tag) Docker Pulls
python Optimized for PYTHON based projects 44 Docker Image Size (tag) Docker Pulls
ruby Optimized for RUBY based projects 38 Docker Image Size (tag) Docker Pulls
rust Optimized for RUST based projects 38 Docker Image Size (tag) Docker Pulls
salesforce Optimized for Salesforce based projects 38 Docker Image Size (tag) Docker Pulls
scala Optimized for SCALA based projects 38 Docker Image Size (tag) Docker Pulls
swift Optimized for SWIFT based projects 38 Docker Image Size (tag) Docker Pulls
terraform Optimized for TERRAFORM based projects 40 Docker Image Size (tag) Docker Pulls

Behind the scenes

How are identified applicable files

  • File extensions: .yml, .yaml

Example calls

v8r --ignore-errors myfile.yml
v8r --ignore-errors myfile.yaml

Help content

v8r <filename>

Validate a local json/yaml file against a schema

Positionals:
  filename  Local file to validate

Options:
      --help           Show help                                       [boolean]
      --version        Show version number                             [boolean]
  -v, --verbose        Run with verbose logging. Can be stacked e.g: -vv -vvv
                                                                         [count]
  -s, --schema         Local path or URL of schema to validate file against. If
                       not supplied, we will attempt to find an appropriate
                       schema on schemastore.org using the filename     [string]
      --ignore-errors  Exit with code 0 even if an error was encountered.
                       Passing this flag means a non-zero exit code is only
                       issued if validation could be completed successfully and
                       the file was invalid           [boolean] [default: false]
      --cache-ttl      Remove cached HTTP responses older than <cache-ttl>
                       seconds old. Passing 0 clears and disables cache
                       completely                        [number] [default: 600]

Installation on mega-linter Docker image

  • NPM packages (node.js):