MegaLinter descriptor

Type: object

Descriptor definition for MegaLinter

No Additional Properties

Type: array of string

Names of the config files to be found (at least one), else descriptor will be deactivated

Each item of this array must be:


Example:

[
    ".editorconfig",
    ".eslintrc.json"
]

Type: array Default: []

MegaLinter flavors matching this descriptor

Each item of this array must be:

Type: enum (of string)

Must be one of:

  • "all_flavors"
  • "all"
  • "ci_light"
  • "cupcake"
  • "documentation"
  • "dotnet"
  • "go"
  • "java"
  • "javascript"
  • "php"
  • "python"
  • "ruby"
  • "rust"
  • "salesforce"
  • "security"
  • "swift"
  • "terraform"

Example:

[
    "all_flavors",
    "java",
    "php"
]

Type: array Default: []

MegaLinter flavors that must not contain this descriptor

Each item of this array must be:

Type: enum (of string)

Must be one of:

  • "all_flavors"
  • "all"
  • "ci_light"
  • "cupcake"
  • "documentation"
  • "dotnet"
  • "go"
  • "java"
  • "javascript"
  • "php"
  • "python"
  • "ruby"
  • "rust"
  • "salesforce"
  • "security"
  • "swift"
  • "terraform"

Example:

[
    "all_flavors",
    "java",
    "php"
]

Type: string Default: ""

Uppercase unique identifier for the language, tooling format or identifier


Examples:

"PYTHON"
"XML"
"OPENAPI"

Type: string Default: ""

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


Examples:

"C++"
"Visual Basic .NET"

Type: enum (of string) Default: ""

Descriptor type: language, format or tooling format

Must be one of:

  • "language"
  • "format"
  • "tooling_format"
  • "other"

Examples:

"language"
"format"
"tooling_format"
"other"

Type: array of string Default: []

Regular expression list for filtering files by their content

Each item of this array must be:


Example:

[
    "AWSTemplateFormatVersion",
    "(AWS|Alexa|Custom)::"
]

Type: array of string Default: []

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

Each item of this array must be:


Example:

[
    "",
    ".json"
]

Type: array of string Default: []

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

Each item of this array must be:


Example:

[
    ".py",
    ""
]

Type: array of string Default: []

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

Each item of this array must be:


Example:

[
    "vault.yml",
    "galaxy.xml"
]

Type: array of string Default: []

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

Each item of this array must be:


Example:

[
    "Dockerfile(-.+)?",
    "Jenkinsfile"
]

Type: string

Set when a linter only lints a sub-directory


Example:

[
    "ansible",
    "kubernetes"
]

Type: object Default: {}

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


Examples:

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

Type: array of string

APK packages identifiers (with or without version)

Each item of this array must be:

Type: string

Example:

[
    "openjdk11"
]

Type: array of string

Cargo packages identifiers (with or without version)

Each item of this array must be:

Type: string

Type: array of string

Will be automatically integrated in generated Dockerfile

Each item of this array must be:


Example:

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

Type: array of string

GEM packages identifiers (with or without version)

Each item of this array must be:

Type: string

Type: array of string

NPM packages identifiers (with or without version)

Each item of this array must be:

Type: string

Example:

[
    "sfdx-cli"
]

Type: array of string

PIP packages identifiers (with or without version)

Each item of this array must be:

Type: string

Type: boolean Default: false

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

Type: boolean Default: false

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

Type: array of object

List of linter definitions associated to the descriptor

Each item of this array must be:

Type: object

Parameters defining behaviour and installation of a linter

No Additional Properties
Example:

{
    "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"
        ]
    },
    "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"
}

Type: array of object Default: []

List of rules to check to activate linter

Each item of this array must be:


Example:

[
    {
        "default_value": "standard",
        "expected_value": "prettier",
        "type": "variable",
        "variable": "JAVASCRIPT_DEFAULT_STYLE"
    }
]

Type: array of string

Names of the config files to be found (at least one), else descriptor will be deactivated

Each item of this array must be:


Example:

[
    ".editorconfig",
    ".eslintrc.json"
]

Type: boolean Default: false

Shows if the linter is capable of output SARIF report within MegaLinter

Type: string

If MegaLinter core is not enough, use a custom class inheriting from Linter class


Examples:

"CSpellLinter"
"DotnetFormatLinter"
"RakuLinter"

Type: array of string Default: []

When a configuration file is used with the linter CLI, send these additional arguments

Each item of this array must be:


Example:

[
    "--no-eslintrc",
    "--no-ignore"
]

Type: array of string Default: []

Arguments for docker run before image name

Each item of this array must be:


Example:

[
    "-v",
    "`pwd`:`pwd`",
    "-w",
    "`pwd`"
]

Type: string

Example:

"norionomura/swiftlint"

Type: string Default: "latest"

Version of the docker image to use for linting


Example:

"0.42.0_swift-5.3.2"

Type: string

Override if different from linter_name

Type: string

Override if different from cli executable used for linting

Type: string

Override if different from cli executable used for linting

Type: array of string

When linter CLI is call for help, send these additional arguments

Each item of this array must be:

Type: array of string

When linter CLI is call for help, send these additional commands

Each item of this array must be:

Type: enum (of string)

Defines how to count errors from log file. regexnumber, regexcount, regexsum, or totallines

Must be one of:

  • "regex_number"
  • "regex_count"
  • "regex_sum"
  • "total_lines"

Examples:

"regex_number"
"regex_count"
"regex_sum"
"total_lines"

Type: string

Regex allowing to extract the number of errors from linter output logs


Example:

"Issues found: (.*) in .* files"

Type: array of string Default: []

When linter CLI is call for linting, send these additional arguments before config args

Each item of this array must be:

Type: array of string Default: []

When linter CLI is call for linting, send these additional arguments after config args

Each item of this array must be:

Type: string

Examples:

"--fix"
"--format"

Type: array of string Default: []

When linter CLI is call for fixing, remove these arguments

Each item of this array must be:


Example:

[
    "--check"
]

Type: string

If the linter can use an ignore file, input here the related argument


Examples:

"--secretlintignore"
"--ignore-path"

Type: enum (of string) Default: "file"

Defines how the linter is called: file, listoffiles, project

Must be one of:

  • "file"
  • "project"
  • "list_of_files"

Type: array of string Default: []

Arguments to generate SARIF output

Each item of this array must be:


Example:

[
    "--format",
    "sarif",
    "--output",
    "{{SARIF_OUTPUT_FILE}}"
]

Type: array of string

When linter CLI is call for version, send these additional arguments

Each item of this array must be:

Type: string

An explanation about the purpose of this instance.


Examples:

".eslintrc.yml"
".markdown-lint.yml"
".python-black"

Type: boolean Default: false

Shows if the linter is deprecated.

Type: string Default: ""

Displays information on why it is deprecated and whether an alternative is available.

Type: array Default: []

MegaLinter flavors matching this linter

Each item of this array must be:

Type: enum (of string)

Must be one of:

  • "all_flavors"
  • "all"
  • "ci_light"
  • "cupcake"
  • "documentation"
  • "dotnet"
  • "go"
  • "java"
  • "javascript"
  • "php"
  • "python"
  • "ruby"
  • "rust"
  • "salesforce"
  • "security"
  • "swift"
  • "terraform"

Example:

[
    "all_flavors",
    "java",
    "php"
]

Type: array Default: []

MegaLinter flavors that must not contain this descriptor

Each item of this array must be:

Type: enum (of string)

Must be one of:

  • "all_flavors"
  • "all"
  • "ci_light"
  • "cupcake"
  • "documentation"
  • "dotnet"
  • "go"
  • "java"
  • "javascript"
  • "php"
  • "python"
  • "ruby"
  • "rust"
  • "salesforce"
  • "security"
  • "swift"
  • "terraform"

Example:

[
    "all_flavors",
    "java",
    "php"
]

Type: boolean Default: false

Disable linter in MegaLinter next builds

Type: boolean Default: false

Indicates that installation instructions does not use the latest release of the linter

Type: array of string

Please add an example with and without configuration file in the command. They will appear in documentation

Each item of this array must be:


Examples:

[
    "golangci-lint run myfile.go",
    "golangci-lint run -c .golangci.yml myfile.go"
]
[
    "eslint myfile.js",
    "eslint -c .eslintrc.yml --no-eslintrc --no-ignore myfile.js"
]

Type: array of string Default: []

File extension filters if different from the ones defined on parent descriptor

Each item of this array must be:


Example:

[
    ".py",
    ""
]

Type: array of string Default: []

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

Each item of this array must be:


Example:

[
    "vault.yml",
    "galaxy.xml"
]

Type: array of string Default: []

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

Each item of this array must be:


Example:

[
    "Dockerfile(-.+)?",
    "Jenkinsfile"
]

Type: string

Set when a linter only lints a sub-directory


Example:

[
    "ansible",
    "kubernetes"
]

Type: object

List of IDE supporting the linter

Type: string

An explanation about the purpose of this instance.


Examples:

".eslintignore"
".secretlintignore"

Type: boolean Default: false

If this property is set to true, this linter will be ignored for flavor suggestions


Examples:

".eslintignore"
".secretlintignore"

Type: object Default: {}

List of apk, dockerfile instructions, npm/pip/gem packages required to install the linter


Examples:

{
    "dockerfile": [
        "FROM accurics/terrascan:latest as terrascan",
        "COPY --from=terrascan /go/bin/terrascan /usr/bin/",
        "RUN terrascan init"
    ]
}
{
    "npm": [
        "eslint",
        "eslint-config-airbnb",
        "eslint-config-prettier",
        "eslint-plugin-jest",
        "eslint-plugin-prettier",
        "babel-eslint"
    ]
}

Type: array of string

APK packages identifiers (with or without version)

Each item of this array must be:


Example:

[
    "perl",
    "perl-dev"
]

Type: array of string

Cargo packages identifiers (with or without version)

Each item of this array must be:


Example:

[
    "clippy",
    "sarif-fmt"
]

Type: array of string

Will be automatically integrated in generated Dockerfile

Each item of this array must be:


Example:

[
    "FROM accurics/terrascan:latest as terrascan",
    "COPY --from=terrascan /go/bin/terrascan /usr/bin/",
    "RUN terrascan init"
]

Type: array of string

GEM packages identifiers (with or without version)

Each item of this array must be:


Example:

[
    "rubocop:0.82.0",
    "rubocop-github:0.16.0",
    "rubocop-performance"
]

Type: array of string

NPM packages identifiers (with or without version)

Each item of this array must be:


Example:

[
    "eslint",
    "eslint-config-airbnb@3.2.1"
]

Type: array of string

PIP packages identifiers (with or without version)

Each item of this array must be:


Example:

[
    "flake8"
]

Type: boolean Default: false

If the linter is just a formatter, set to true so errors will count as warnings

Type: boolean Default: false

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

Type: boolean Default: false

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

Type: stringFormat: uri

URL of an image used to build header of linter Markdown documentation


Example:

"https://github.com/stylelint/stylelint/raw/master/identity/stylelint-icon-and-text-white.png"

Type: string

If the linter is unable to return help content, hardcode it here

Type: stringFormat: uri

URL of an image used in linter Markdown documentation


Example:

"https://raku.org/camelia-logo.png"

Type: string

URL to linter documentation referring to MegaLinter

Type: string

Name of the linter (same as cli command if possible)


Example:

"eslint"

Type: stringFormat: uri

URL of the linter repository home page


Example:

"https://github.com/eslint/eslint"

Type: stringFormat: uri

URL to linter documentation explaining how to configure the linter

Type: stringFormat: uri

URL to linter documentation explaining how to ignore files

Type: stringFormat: uri

URL to linter documentation explaining how to disable rules directly with comments in files

Type: stringFormat: uri

URL to linter documentation listing all the rules that can be detected

Type: string

spdx license id of the linter

Type: enum (of integer)

Average speed of the linter (performances indicator). For 1 (very slow) to 5 (very fast)

Must be one of:

  • 1
  • 2
  • 3
  • 4
  • 5

Type: stringFormat: uri

URL of the linter home page


Example:

"https://eslint.org"

Type: string

If the linter is unable to return a version number, hardcode it here

Type: string

When several linters in a descriptor, set a different name that will be used for configuration


Example:

"JAVASCRIPT_ES"

Type: array Default: []

Custom bash commands to run after linter

Each item of this array must be:

Type: object

Command information

Type: string

Examples:

"npm run test"
"echo \"This is a custom command\""

Type: enum (of string)

Must be one of:

  • "root"
  • "workspace"

Examples:

"root"
"workspace"

Example:

[
    {
        "command": "npm install java-caller",
        "continue_if_failed": false,
        "cwd": "root"
    },
    {
        "command": "echo \"linter post-run command has been called\"",
        "cwd": "workspace"
    }
]

Type: array Default: []

Custom bash commands to run before linter

Each item of this array must be:

Type: object

Command information

Type: string

Examples:

"npm run test"
"echo \"This is a custom command\""

Type: enum (of string)

Must be one of:

  • "root"
  • "workspace"

Examples:

"root"
"workspace"

Example:

[
    {
        "command": "tflint --init",
        "continue_if_failed": false,
        "cwd": "root"
    },
    {
        "command": "echo \"linter pre-run command has been called\"",
        "cwd": "workspace"
    }
]

Type: string

Path to find default SARIF output file when generated by linter


Example:

[
    "./results.sarif"
]

Type: string

Test folder containing good and bad files, if different from parent descriptor test_folder


Example:

[
    "bash_shfmt",
    "terraform_terrascan"
]

Type: object

List of variables to set before running tests


Example:

{
    "JAVASCRIPT_DEFAULT_STYLE": "prettier"
}

Type: array

Try to not use this property except if you really have no choice


Example:

{
    "default_value": "false",
    "description": "If set to `false`, the `bash-exec` linter will report a warning if a shell script is not executable. If set to `true`, the `bash-exec` linter will report an error instead",
    "name": "ERROR_ON_MISSING_EXEC_BIT"
}

Type: string

If default regex to extract version from linter -v call, override it here


Example:

"(?<=npm-groovy-lint version )\\d+(\\.\\d+)+"

Example:

[
    {
        "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"
            ]
        },
        "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"
    }
]

Type: number Default: 0

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


Example:

[
    -9,
    0,
    9
]

Type: string

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


Example:

[
    "bash_shfmt",
    "terraform_terrascan"
]