Type object
File match *.megalinter-descriptor.yml
Schema URL https://catalog.lintel.tools/schemas/schemastore/megalinter-descriptor/latest.json
Source https://raw.githubusercontent.com/megalinter/megalinter/main/megalinter/descriptors/schemas/megalinter-descriptor.jsonschema.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Descriptor definition for MegaLinter

Properties

descriptor_id string required

Uppercase unique identifier for the language, tooling format or identifier

Default: ""
Examples: "PYTHON", "XML", "OPENAPI"
descriptor_type string required

Descriptor type: language, format or tooling format

Default: ""
Values: "language" "format" "tooling_format" "other"
Examples: "language", "format", "tooling_format", "other"
linters object[] required

List of linter definitions associated to the descriptor

Examples: [{"cli_config_extra_args":["--no-eslintrc","--no-ignore"],"config_file_name":".eslintrc.yml","examples":["eslint myfile.js","eslint -c .eslintrc.yml --no-eslintrc --no-ignore myfile.js"],"install":{"npm":["eslint","eslint-config-airbnb","eslint-config-prettier","eslint-plugin-jest","eslint-plugin-prettier","@babel/eslint-parser"]},"linter_banner_image_url":"https://d33wubrfki0l68.cloudfront.net/3b5ac7586466159bb6f237b633bfc4f5a8d5acf8/ee0a1/assets/img/posts/eslint-collective.png","linter_name":"eslint","linter_url":"https://eslint.org","name":"JAVASCRIPT_ES"},{"examples":["standard myfile.js"],"install":{"npm":["standard"]},"linter_banner_image_url":"https://github.com/standard/standard/raw/master/sticker.png","linter_name":"standard","linter_url":"https://github.com/standard/standard","name":"JAVASCRIPT_STANDARD"}]
active_only_if_file_found string[]

Names of the config files to be found (at least one), else descriptor will be deactivated. Search in workspace, linter rules path, and files_sub_directory

Examples: [".editorconfig",".eslintrc.json"]
descriptor_flavors enum_flavors[]

MegaLinter flavors matching this descriptor

Default:
[]
Examples: ["all_flavors","java","php"]
descriptor_flavors_exclude enum_flavors[]

MegaLinter flavors that must not contain this descriptor

Default:
[]
Examples: ["all_flavors","java","php"]
descriptor_label string

Label for descriptor documentation, if different from Id. Ex: C++ for CPP

Default: ""
Examples: "C++", "Visual Basic .NET"
file_contains_regex string[]

Regular expression list for filtering files by their content

Default:
[]
Examples: ["AWSTemplateFormatVersion","(AWS|Alexa|Custom)::"]
file_contains_regex_extensions string[]

If file_contains_regex is set, use this property to filter extensions of the files that will be checked

Default:
[]
Examples: ["",".json"]
file_extensions string[]

File extension filters. Empty list excludes all files. Can be overridden at linter level

Default:
[]
Examples: [".py",""]
file_names_not_ends_with string[]

List of strings to filter the files according to their end of file name

Default:
[]
Examples: ["vault.yml","galaxy.xml"]
file_names_regex string[]

Regular expression list for filtering files by their base names using regex full match. Empty list includes all files. Can be overridden at linter level

Default:
[]
Examples: ["Dockerfile(-.+)?","Jenkinsfile"]
files_sub_directory string

Set when a linter only lints a sub-directory

Examples: ["ansible","kubernetes"]
install object

List of apk, dockerfile instructions, npm/pip/gem packages required to use the descriptor linters

Default:
{}
Examples: {"apk":["openjdk11"]}, {"dockerfile":["ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk","ENV PATH=\"$JAVA_HOME/bin:${PATH}\""]}, {"npm":["sfdx-cli"]}
6 nested properties
apk string[]

APK packages identifiers (with or without version)

Examples: ["openjdk11"]
cargo string[]

Cargo packages identifiers (with or without version)

dockerfile string[]

Will be automatically integrated in generated Dockerfile

Examples: ["ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk","ENV PATH=\"$JAVA_HOME/bin:${PATH}\""]
gem string[]

GEM packages identifiers (with or without version)

npm string[]

NPM packages identifiers (with or without version)

Examples: ["sfdx-cli"]
pip string[]

PIP packages identifiers (with or without version)

lint_all_files boolean

If set to true, this descriptor linters will always lint all files, undepending their name/extensions/content

Default: false
lint_all_other_linters_files boolean

If set to true, this descriptor linters will lint one by one all files collected by all other linters

Default: false
processing_order number

If descriptor linters may be slow, put a negative processing order. If it is fast, put a positive one. If you don't know, do not set

Default: 0
Examples: [-9,0,9]
supported_platforms object

Specifies the supported target platforms (OS, CPU architecture, CPU variant) for the install of this descriptor, and optionally overrides install instructions for a specific platform. Uses the same architecture naming conventions as Docker.

Default:
{
  "platform": [
    "linux/amd64"
  ]
}
Examples: {"platform":["linux/amd64","linux/arm64"]}, {"platform":["linux/amd64"]}, {"install_override":[{"install":{"dockerfile":["ARG PWSH_VERSION='latest'","ARG PWSH_DIRECTORY='/opt/microsoft/powershell'","RUN mkdir -p ${PWSH_DIRECTORY} \\\n && curl --retry 5 --retry-delay 5 -s https://api.github.com/repos/powershell/powershell/releases/${PWSH_VERSION} \\\n | grep browser_download_url \\\n | grep linux-arm64 \\\n | cut -d '\"' -f 4 \\\n | xargs -n 1 wget -O - \\\n | tar -xzC ${PWSH_DIRECTORY} \\\n && ln -sf ${PWSH_DIRECTORY}/pwsh /usr/bin/pwsh\n"]},"platform":"linux/arm64"}],"platform":["linux/amd64","linux/arm64"]}
2 nested properties
install_override object[]

Defines special installation steps for a specific platform (OS/CPU architecture/CPU variant), replacing the descriptor's install instructions given in the install node for this target platform only.

platform string[]

The list of target platforms (OS/CPU architecture/CPU Variant) that this descriptor supports.

Default:
[
  "linux/amd64"
]
Examples: ["linux/amd64","linux/arm64"], ["linux/amd64"]
uniqueItems=true
test_folder string

Test folder containing good and bad files. Default: lowercase(descriptor_id)

Examples: ["bash_shfmt","terraform_terrascan"]

Definitions

command_info object

Command information

command string
Examples: "npm run test", "echo "This is a custom command""
continue_if_failed boolean
Default: true
cwd string
Values: "root" "workspace"
Examples: "root", "workspace"
enum_flavors string
linter_command_info object

Command information

command string
Examples: "npm run test", "echo "This is a custom command""
continue_if_failed boolean
Default: true
cwd string
Values: "root" "workspace"
Examples: "root", "workspace"