Mega-Linter descriptor

Type: object

Descriptor definition for Mega-Linter

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:

Type: string

Example:

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

Type: array Default: []

Mega-Linter flavors matching this descriptor

Each item of this array must be:

Type: enum (of string)

Must be one of:

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

Example:

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

Type: array Default: []

Mega-Linter flavors that must not contain this descriptor

Each item of this array must be:


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:

Type: string

Example:

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

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:

Type: string

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:

Type: string

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:

Type: string

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": [
        "openjdk8"
    ]
}
{
    "dockerfile": [
        "ENV JAVA_HOME=/usr/lib/jvm/java-1.8-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:

[
    "openjdk8"
]

Type: array of string

Will be automatically integrated in generated Dockerfile

Each item of this array must be:

Type: string

Example:

[
    "ENV JAVA_HOME=/usr/lib/jvm/java-1.8-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://i.imgur.com/CFdruO8.jpg",
    "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: string

If Mega-Linter 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: enum (of string) Default: "file_by_file"

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

Must be one of:

  • "file_by_file"
  • "project"
  • "list_of_files"

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: array Default: []

Mega-Linter flavors matching this linter

Each item of this array must be:


Example:

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

Type: array Default: []

Mega-Linter flavors that must not contain this descriptor

Each item of this array must be:


Example:

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

Type: boolean Default: false

Disable linter in Mega-Linter next builds

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: string

Set when a linter only lints a sub-directory


Example:

[
    "ansible",
    "kubernetes"
]

Type: object

List of IDE supporting the linter

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

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: string

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: string

URL of an image used in linter Markdown documentation


Example:

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

Type: string

URL to linter documentation referring to Mega-Linter

Type: string

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


Example:

"eslint"

Type: string

URL of the linter repository home page


Example:

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

Type: string

URL to linter documentation explaining how to configure the linter

Type: string

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

Type: string

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

Type: string

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:


Example:

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

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 arror 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://i.imgur.com/CFdruO8.jpg",
        "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"
]