{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/megalinter-descriptor/latest.json",
  "title": "MegaLinter descriptor",
  "description": "Descriptor definition for MegaLinter",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/megalinter/megalinter/main/megalinter/descriptors/schemas/megalinter-descriptor.jsonschema.json",
    "sourceSha256": "d8df9b81362fced7494e69e9cdd9aed5e715fd521e66f6b40f3210c0b6bc7a64",
    "fileMatch": [
      "*.megalinter-descriptor.yml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "active_only_if_file_found": {
      "type": "array",
      "description": "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"
        ]
      ],
      "items": {
        "type": "string"
      },
      "title": "Active if one of file names found"
    },
    "descriptor_flavors": {
      "type": "array",
      "default": [],
      "description": "MegaLinter flavors matching this descriptor",
      "examples": [
        [
          "all_flavors",
          "java",
          "php"
        ]
      ],
      "items": {
        "$ref": "#/$defs/enum_flavors"
      },
      "title": "Flavors"
    },
    "descriptor_flavors_exclude": {
      "type": "array",
      "default": [],
      "description": "MegaLinter flavors that must not contain this descriptor",
      "examples": [
        [
          "all_flavors",
          "java",
          "php"
        ]
      ],
      "items": {
        "$ref": "#/$defs/enum_flavors"
      },
      "title": "Flavors"
    },
    "descriptor_id": {
      "type": "string",
      "default": "",
      "description": "Uppercase unique identifier for the language, tooling format or identifier",
      "examples": [
        "PYTHON",
        "XML",
        "OPENAPI"
      ],
      "title": "Descriptor unique identifier"
    },
    "descriptor_label": {
      "type": "string",
      "default": "",
      "description": "Label for descriptor documentation, if different from Id. Ex: C++ for CPP",
      "examples": [
        "C++",
        "Visual Basic .NET"
      ],
      "title": "Descriptor label"
    },
    "descriptor_type": {
      "type": "string",
      "default": "",
      "description": "Descriptor type: language, format or tooling format",
      "enum": [
        "language",
        "format",
        "tooling_format",
        "other"
      ],
      "examples": [
        "language",
        "format",
        "tooling_format",
        "other"
      ],
      "title": "Descriptor type"
    },
    "file_contains_regex": {
      "type": "array",
      "default": [],
      "description": "Regular expression list for filtering files by their content",
      "examples": [
        [
          "AWSTemplateFormatVersion",
          "(AWS|Alexa|Custom)::"
        ]
      ],
      "items": {
        "type": "string"
      },
      "title": "File content regex filters"
    },
    "file_contains_regex_extensions": {
      "type": "array",
      "default": [],
      "description": "If file_contains_regex is set, use this property to filter extensions of the files that will be checked",
      "examples": [
        [
          "",
          ".json"
        ]
      ],
      "items": {
        "type": "string"
      },
      "title": "File contain regex extensions filters"
    },
    "file_extensions": {
      "type": "array",
      "default": [],
      "description": "File extension filters. Empty list excludes all files. Can be overridden at linter level",
      "examples": [
        [
          ".py",
          ""
        ]
      ],
      "items": {
        "type": "string"
      },
      "title": "Allowed file extensions"
    },
    "file_names_not_ends_with": {
      "type": "array",
      "default": [],
      "description": "List of strings to filter the files according to their end of file name",
      "examples": [
        [
          "vault.yml",
          "galaxy.xml"
        ]
      ],
      "items": {
        "type": "string"
      },
      "title": "Filter on end of file name"
    },
    "file_names_regex": {
      "type": "array",
      "default": [],
      "description": "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",
      "examples": [
        [
          "Dockerfile(-.+)?",
          "Jenkinsfile"
        ]
      ],
      "items": {
        "type": "string"
      },
      "title": "File name regex filters"
    },
    "files_sub_directory": {
      "type": "string",
      "description": "Set when a linter only lints a sub-directory",
      "examples": [
        [
          "ansible",
          "kubernetes"
        ]
      ],
      "title": "Files sub-directory"
    },
    "install": {
      "type": "object",
      "default": {},
      "description": "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"
          ]
        }
      ],
      "properties": {
        "apk": {
          "type": "array",
          "description": "APK packages identifiers (with or without version)",
          "examples": [
            [
              "openjdk11"
            ]
          ],
          "items": {
            "type": "string"
          },
          "title": "List of APK packages (Linux)"
        },
        "cargo": {
          "type": "array",
          "description": "Cargo packages identifiers (with or without version)",
          "items": {
            "type": "string"
          },
          "title": "List of Cargo packages (Rust)"
        },
        "dockerfile": {
          "type": "array",
          "description": "Will be automatically integrated in generated Dockerfile",
          "examples": [
            [
              "ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk",
              "ENV PATH=\"$JAVA_HOME/bin:${PATH}\""
            ]
          ],
          "items": {
            "type": "string"
          },
          "title": "List of Dockerfile instructions packages"
        },
        "gem": {
          "type": "array",
          "description": "GEM packages identifiers (with or without version)",
          "items": {
            "type": "string"
          },
          "title": "List of GEM packages (Ruby)"
        },
        "npm": {
          "type": "array",
          "description": "NPM packages identifiers (with or without version)",
          "examples": [
            [
              "sfdx-cli"
            ]
          ],
          "items": {
            "type": "string"
          },
          "title": "List of NPM packages (Node.js)"
        },
        "pip": {
          "type": "array",
          "description": "PIP packages identifiers (with or without version)",
          "items": {
            "type": "string"
          },
          "title": "List of PIP packages (Python)"
        }
      },
      "title": "Installation requirements"
    },
    "lint_all_files": {
      "type": "boolean",
      "default": false,
      "description": "If set to true, this descriptor linters will always lint all files, undepending their name/extensions/content",
      "title": "Lint all files"
    },
    "lint_all_other_linters_files": {
      "type": "boolean",
      "default": false,
      "description": "If set to true, this descriptor linters will lint one by one all files collected by all other linters",
      "title": "Lint all other linters files"
    },
    "linters": {
      "type": "array",
      "description": "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"
          }
        ]
      ],
      "items": {
        "type": "object",
        "title": "Linter definition",
        "description": "Parameters defining behaviour and installation of a linter",
        "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"
              ]
            },
            "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"
          }
        ],
        "properties": {
          "activation_rules": {
            "type": "array",
            "default": [],
            "description": "List of rules to check to activate linter",
            "examples": [
              [
                {
                  "default_value": "standard",
                  "expected_value": "prettier",
                  "type": "variable",
                  "variable": "JAVASCRIPT_DEFAULT_STYLE"
                }
              ]
            ],
            "items": {
              "type": "object"
            },
            "title": "Activation rules"
          },
          "active_only_if_file_found": {
            "type": "array",
            "description": "Names of the config files to be found (at least one), else descriptor will be deactivated",
            "examples": [
              [
                ".editorconfig",
                ".eslintrc.json"
              ]
            ],
            "items": {
              "type": "string"
            },
            "title": "Active if one of file names found"
          },
          "can_output_sarif": {
            "type": "boolean",
            "default": false,
            "description": "Shows if the linter is capable of output SARIF report within MegaLinter",
            "title": "Can output SARIF"
          },
          "class": {
            "type": "string",
            "description": "If MegaLinter core is not enough, use a custom class inheriting from Linter class",
            "examples": [
              "CSpellLinter",
              "DotnetFormatLinter",
              "RakuLinter"
            ],
            "title": "Linter custom python class name"
          },
          "cli_config_arg_name": {
            "type": "string",
            "title": "CLI configuration file argument name if different from -c"
          },
          "cli_config_default_value": {
            "type": "string",
            "title": "Default value for config argument, in case it is not a file"
          },
          "cli_config_extra_args": {
            "type": "array",
            "default": [],
            "description": "When a configuration file is used with the linter CLI, send these additional arguments",
            "examples": [
              [
                "--no-eslintrc",
                "--no-ignore"
              ]
            ],
            "items": {
              "type": "string"
            },
            "title": "Additional CLI arguments when config file is used"
          },
          "cli_docker_args": {
            "type": "array",
            "default": [],
            "description": "Arguments for docker run before image name",
            "examples": [
              [
                "-v",
                "`pwd`:`pwd`",
                "-w",
                "`pwd`"
              ]
            ],
            "items": {
              "type": "string"
            },
            "title": "CLI docker run arguments"
          },
          "cli_docker_image": {
            "type": "string",
            "examples": [
              "norionomura/swiftlint"
            ],
            "title": "Name of the docker image to use for linting"
          },
          "cli_docker_image_version": {
            "type": "string",
            "default": "latest",
            "description": "Version of the docker image to use for linting",
            "examples": [
              "0.42.0_swift-5.3.2"
            ],
            "title": "Docker image version"
          },
          "cli_executable": {
            "type": "string",
            "description": "Override if different from linter_name",
            "title": "CLI executable for linting request"
          },
          "cli_executable_help": {
            "type": "string",
            "description": "Override if different from cli executable used for linting",
            "title": "CLI executable for help request"
          },
          "cli_executable_version": {
            "type": "string",
            "description": "Override if different from cli executable used for linting",
            "title": "CLI executable for version request"
          },
          "cli_help_arg_name": {
            "type": "string",
            "title": "CLI Help argument name if different from -h"
          },
          "cli_help_extra_args": {
            "type": "array",
            "description": "When linter CLI is call for help, send these additional arguments",
            "items": {
              "type": "string"
            },
            "title": "CLI help extra arguments"
          },
          "cli_help_extra_commands": {
            "type": "array",
            "description": "When linter CLI is call for help, send these additional commands",
            "items": {
              "type": "string"
            },
            "title": "CLI help extra commands"
          },
          "cli_lint_errors_count": {
            "type": "string",
            "description": "Defines how to count errors from log file. regex_number, regex_count, regex_sum, total_lines or sarif",
            "enum": [
              "regex_number",
              "regex_count",
              "regex_sum",
              "total_lines",
              "sarif"
            ],
            "examples": [
              "regex_number",
              "regex_count",
              "regex_sum",
              "total_lines",
              "sarif"
            ],
            "title": "Lint errors count mode"
          },
          "cli_lint_errors_regex": {
            "type": "string",
            "description": "Regex allowing to extract the number of errors from linter output logs",
            "examples": [
              "Issues found: (.*) in .* files"
            ],
            "title": "Lint errors number regex"
          },
          "cli_lint_extra_args": {
            "type": "array",
            "default": [],
            "description": "When linter CLI is call for linting, send these additional arguments before config args",
            "items": {
              "type": "string"
            },
            "title": "CLI Lint extra arguments (before config args)"
          },
          "cli_lint_extra_args_after": {
            "type": "array",
            "default": [],
            "description": "When linter CLI is call for linting, send these additional arguments after config args",
            "items": {
              "type": "string"
            },
            "title": "CLI Lint extra arguments (after config args)"
          },
          "cli_lint_fix_arg_name": {
            "type": "string",
            "examples": [
              "--fix",
              "--format"
            ],
            "title": "If the linter can format or fix, input here the related triggering argument"
          },
          "cli_lint_fix_remove_args": {
            "type": "array",
            "default": [],
            "description": "When linter CLI is call for fixing, remove these arguments",
            "examples": [
              [
                "--check"
              ]
            ],
            "items": {
              "type": "string"
            },
            "title": "CLI Lint arguments to remove if fix is activated"
          },
          "cli_lint_ignore_arg_name": {
            "type": "string",
            "description": "If the linter can use an ignore file, input here the related argument",
            "examples": [
              "--secretlintignore",
              "--ignore-path"
            ],
            "title": "Path to ignore file argument name"
          },
          "cli_lint_mode": {
            "type": "string",
            "default": "file",
            "description": "Defines how the linter is called: file,  list_of_files, project",
            "enum": [
              "file",
              "project",
              "list_of_files"
            ],
            "title": "Linting mode"
          },
          "cli_lint_warnings_count": {
            "type": "string",
            "description": "Defines how to count warnings from log file. regex_number, regex_count, regex_sum, total_lines or sarif",
            "enum": [
              "regex_number",
              "regex_count",
              "regex_sum",
              "total_lines",
              "sarif"
            ],
            "examples": [
              "regex_number",
              "regex_count",
              "regex_sum",
              "total_lines",
              "sarif"
            ],
            "title": "Lint errors count mode"
          },
          "cli_lint_warnings_regex": {
            "type": "string",
            "description": "Regex allowing to extract the number of warnings from linter output logs",
            "examples": [
              "Issues found: (.*) in .* files"
            ],
            "title": "Lint warnings number regex"
          },
          "cli_sarif_args": {
            "type": "array",
            "default": [],
            "description": "Arguments to generate SARIF output",
            "examples": [
              [
                "--format",
                "sarif",
                "--output",
                "{{SARIF_OUTPUT_FILE}}"
              ]
            ],
            "items": {
              "type": "string"
            },
            "title": "CLI SARIF run arguments"
          },
          "cli_version_arg_name": {
            "type": "string",
            "title": "CLI version argument name if different from -v"
          },
          "cli_version_extra_args": {
            "type": "array",
            "description": "When linter CLI is call for version, send these additional arguments",
            "items": {
              "type": "string"
            },
            "title": "CLI Version extra arguments"
          },
          "config_file_name": {
            "type": "string",
            "description": "An explanation about the purpose of this instance.",
            "examples": [
              ".eslintrc.yml",
              ".markdown-lint.yml",
              ".python-black"
            ],
            "title": "Default file name for the linter configuration file"
          },
          "deprecated": {
            "type": "boolean",
            "default": false,
            "description": "Shows if the linter is deprecated.",
            "title": "Is the linter deprecated?"
          },
          "deprecated_description": {
            "type": "string",
            "default": "",
            "description": "Displays information on why it is deprecated and whether an alternative is available.",
            "title": "Description of the deprecated linter"
          },
          "descriptor_flavors": {
            "type": "array",
            "default": [],
            "description": "MegaLinter flavors matching this linter",
            "examples": [
              [
                "all_flavors",
                "java",
                "php"
              ]
            ],
            "items": {
              "$ref": "#/$defs/enum_flavors"
            },
            "title": "Flavors"
          },
          "descriptor_flavors_exclude": {
            "type": "array",
            "default": [],
            "description": "MegaLinter flavors that must not contain this descriptor",
            "examples": [
              [
                "all_flavors",
                "java",
                "php"
              ]
            ],
            "items": {
              "$ref": "#/$defs/enum_flavors"
            },
            "title": "Flavors"
          },
          "disabled": {
            "type": "boolean",
            "default": false,
            "description": "Disable linter in MegaLinter next builds",
            "title": "Disabled"
          },
          "disabled_reason": {
            "type": "string",
            "default": false,
            "description": "Explanation about why the linter is disabled",
            "title": "Disabled reason"
          },
          "downgraded_reason": {
            "type": "string",
            "default": false,
            "description": "Explanation about why the linter is downgraded",
            "title": "Downgraded reason"
          },
          "downgraded_version": {
            "type": "boolean",
            "default": false,
            "description": "Indicates that installation instructions does not use the latest release of the linter",
            "title": "Downgraded version"
          },
          "examples": {
            "type": "array",
            "description": "Please add an example with and without configuration file in the command. They will appear in documentation",
            "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"
              ]
            ],
            "items": {
              "type": "string"
            },
            "title": "Linter CLI commands examples"
          },
          "file_extensions": {
            "type": "array",
            "default": [],
            "description": "File extension filters if different from the ones defined on parent descriptor",
            "examples": [
              [
                ".py",
                ""
              ]
            ],
            "items": {
              "type": "string"
            },
            "title": "Allowed file extensions"
          },
          "file_names_not_ends_with": {
            "type": "array",
            "default": [],
            "description": "List of strings to filter the files according to their end of file name",
            "examples": [
              [
                "vault.yml",
                "galaxy.xml"
              ]
            ],
            "items": {
              "type": "string"
            },
            "title": "Filter on end of file name"
          },
          "file_names_regex": {
            "type": "array",
            "default": [],
            "description": "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",
            "examples": [
              [
                "Dockerfile(-.+)?",
                "Jenkinsfile"
              ]
            ],
            "items": {
              "type": "string"
            },
            "title": "File name regex filters"
          },
          "files_sub_directory": {
            "type": "string",
            "description": "Set when a linter only lints a sub-directory",
            "examples": [
              [
                "ansible",
                "kubernetes"
              ]
            ],
            "title": "Files sub-directory"
          },
          "help_command_return_code": {
            "type": "number",
            "title": "CLI Help valid return code if different from 0"
          },
          "ide": {
            "type": "object",
            "description": "List of IDE supporting the linter",
            "title": "IDE Integration"
          },
          "ignore_file_name": {
            "type": "string",
            "description": "An explanation about the purpose of this instance.",
            "examples": [
              ".eslintignore",
              ".secretlintignore"
            ],
            "title": "Default file name for the linter ignore file"
          },
          "ignore_for_flavor_suggestions": {
            "type": "boolean",
            "default": false,
            "description": "If this property is set to true, this linter will be ignored for flavor suggestions",
            "examples": [
              ".eslintignore",
              ".secretlintignore"
            ],
            "title": "Ignore for flavor suggestions"
          },
          "install": {
            "type": "object",
            "default": {},
            "description": "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"
                ]
              }
            ],
            "properties": {
              "apk": {
                "type": "array",
                "description": "APK packages identifiers (with or without version)",
                "examples": [
                  [
                    "perl",
                    "perl-dev"
                  ]
                ],
                "items": {
                  "type": "string"
                },
                "title": "List of APK packages (Linux)"
              },
              "cargo": {
                "type": "array",
                "description": "Cargo packages identifiers (with or without version)",
                "examples": [
                  [
                    "clippy",
                    "sarif-fmt"
                  ]
                ],
                "items": {
                  "type": "string"
                },
                "title": "List of Cargo packages (Rust)"
              },
              "dockerfile": {
                "type": "array",
                "description": "Will be automatically integrated in generated Dockerfile",
                "examples": [
                  [
                    "FROM accurics/terrascan:latest as terrascan",
                    "COPY --from=terrascan /go/bin/terrascan /usr/bin/",
                    "RUN terrascan init"
                  ]
                ],
                "items": {
                  "type": "string"
                },
                "title": "List of Dockerfile instructions packages"
              },
              "gem": {
                "type": "array",
                "description": "GEM packages identifiers (with or without version)",
                "examples": [
                  [
                    "rubocop:0.82.0",
                    "rubocop-github:0.16.0",
                    "rubocop-performance"
                  ]
                ],
                "items": {
                  "type": "string"
                },
                "title": "List of GEM packages (Ruby)"
              },
              "npm": {
                "type": "array",
                "description": "NPM packages identifiers (with or without version)",
                "examples": [
                  [
                    "eslint",
                    "eslint-config-airbnb@3.2.1"
                  ]
                ],
                "items": {
                  "type": "string"
                },
                "title": "List of NPM packages (Node.js)"
              },
              "pip": {
                "type": "array",
                "description": "PIP packages identifiers (with or without version)",
                "examples": [
                  [
                    "flake8"
                  ]
                ],
                "items": {
                  "type": "string"
                },
                "title": "List of PIP packages (Python)"
              }
            },
            "title": "Installation requirements"
          },
          "is_formatter": {
            "type": "boolean",
            "default": false,
            "description": "If the linter is just a formatter, set to true so errors will count as warnings",
            "title": "Is formatter"
          },
          "is_sbom": {
            "type": "boolean",
            "default": false,
            "description": "If the linter is SBOM, set to true so extra properties will be returned",
            "title": "Is SBOM"
          },
          "lint_all_files": {
            "type": "boolean",
            "default": false,
            "description": "If set to true, this linter will always lint all files, undepending their name/extensions/content",
            "title": "Lint all files"
          },
          "lint_all_other_linters_files": {
            "type": "boolean",
            "default": false,
            "description": "If set to true, this descriptor linters will lint one by one all files collected by all other linters",
            "title": "Lint all other linters files"
          },
          "linter_banner_image_url": {
            "type": "string",
            "description": "URL of an image used to build header of linter Markdown documentation",
            "examples": [
              "https://github.com/stylelint/stylelint/raw/main/identity/stylelint-icon-and-text-white.png"
            ],
            "format": "uri",
            "title": "Linter banner image URL"
          },
          "linter_help_cache": {
            "type": "string",
            "description": "If the linter is unable to return help content, hardcode it here",
            "title": "Hardcoded help content"
          },
          "linter_icon_png_url": {
            "type": "string",
            "description": "URL of a PNG image representing the icon of the linter",
            "examples": [
              "https://github.com/stylelint/stylelint/raw/main/identity/stylelint-icon-and-text-white.png"
            ],
            "format": "uri",
            "title": "Linter Icon PNG URL"
          },
          "linter_image_url": {
            "type": "string",
            "description": "URL of an image used in linter Markdown documentation",
            "examples": [
              "https://raku.org/camelia-logo.png"
            ],
            "format": "uri",
            "title": "Linter image URL"
          },
          "linter_megalinter_ref_url": {
            "type": "string",
            "description": "URL to linter documentation referring to MegaLinter",
            "title": "MegaLinter reference URL"
          },
          "linter_name": {
            "type": "string",
            "description": "Name of the linter (same as cli command if possible)",
            "examples": [
              "eslint"
            ],
            "title": "Linter name"
          },
          "linter_repo": {
            "type": "string",
            "description": "URL of the linter repository home page",
            "examples": [
              "https://github.com/eslint/eslint"
            ],
            "format": "uri",
            "title": "Linter URL"
          },
          "linter_rules_configuration_url": {
            "type": "string",
            "description": "URL to linter documentation explaining how to configure the linter",
            "format": "uri",
            "title": "Linter rules configuration URL"
          },
          "linter_rules_ignore_config_url": {
            "type": "string",
            "description": "URL to linter documentation explaining how to ignore files",
            "format": "uri",
            "title": "Linter rules ignore config URL"
          },
          "linter_rules_inline_disable_url": {
            "type": "string",
            "description": "URL to linter documentation explaining how to disable rules directly with comments in files",
            "format": "uri",
            "title": "Linter rules inline disable URL"
          },
          "linter_rules_url": {
            "type": "string",
            "description": "URL to linter documentation listing all the rules that can be detected",
            "format": "uri",
            "title": "Linter rules URL"
          },
          "linter_spdx_license": {
            "type": "string",
            "description": "spdx license id of the linter",
            "title": "spdx license"
          },
          "linter_speed": {
            "type": "number",
            "description": "Average speed of the linter (performances indicator). For 1 (very slow) to 5 (very fast)",
            "enum": [
              1,
              2,
              3,
              4,
              5
            ],
            "title": "Speed indicator"
          },
          "linter_text": {
            "type": "string",
            "title": "Additional text for MegaLinter online documentation"
          },
          "linter_url": {
            "type": "string",
            "description": "URL of the linter home page",
            "examples": [
              "https://eslint.org"
            ],
            "format": "uri",
            "title": "Linter URL"
          },
          "linter_version_cache": {
            "type": "string",
            "description": "If the linter is unable to return a version number, hardcode it here",
            "title": "Hardcoded version number"
          },
          "name": {
            "type": "string",
            "description": "When several linters in a descriptor, set a different name that will be used for configuration",
            "examples": [
              "JAVASCRIPT_ES"
            ],
            "title": "Linter configuration key"
          },
          "post_commands": {
            "type": "array",
            "default": [],
            "description": "Custom bash commands to run after linter",
            "examples": [
              [
                {
                  "command": "npm install java-caller",
                  "continue_if_failed": false,
                  "cwd": "root"
                },
                {
                  "command": "echo \"linter post-run command has been called\"",
                  "cwd": "workspace"
                }
              ]
            ],
            "items": {
              "$ref": "#/$defs/linter_command_info"
            },
            "title": "Linter Pre-run commands"
          },
          "pre_commands": {
            "type": "array",
            "default": [],
            "description": "Custom bash commands to run before linter",
            "examples": [
              [
                {
                  "command": "tflint --init",
                  "continue_if_failed": false,
                  "cwd": "root"
                },
                {
                  "command": "echo \"linter pre-run command has been called\"",
                  "cwd": "workspace"
                }
              ]
            ],
            "items": {
              "$ref": "#/$defs/linter_command_info"
            },
            "title": "Linter Pre-run commands"
          },
          "sarif_default_output_file": {
            "type": "string",
            "description": "Path to find default SARIF output file when generated by linter",
            "examples": [
              [
                "./results.sarif"
              ]
            ],
            "title": "SARIF default output file"
          },
          "supported_platforms": {
            "type": "object",
            "default": {
              "platform": [
                "linux/amd64"
              ]
            },
            "description": "Specifies the supported target platforms (OS, CPU architecture, CPU variant) for the linters, and optionally overrides install instructions for a specific platform. Uses the same [architecture naming conventions as Docker](https://docs.docker.com/desktop/multi-arch/).",
            "examples": [
              {
                "platform": [
                  "linux/amd64",
                  "linux/arm64"
                ]
              },
              {
                "platform": [
                  "linux/amd64"
                ]
              },
              {
                "install_override": [
                  {
                    "install": {
                      "dockerfile": [
                        "RUN ML_THIRD_PARTY_DIR=\"/third-party/shellcheck\" \\\n    && mkdir -p ${ML_THIRD_PARTY_DIR} \\\n    && wget -qO- \"https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.aarch64.tar.xz\" | tar -xJv --directory ${ML_THIRD_PARTY_DIR} \\\n    && mv \"${ML_THIRD_PARTY_DIR}/shellcheck-stable/shellcheck\" /usr/bin/ \\\n    && find ${ML_THIRD_PARTY_DIR} -type f -not -name 'LICENSE*' -delete -o -type d -empty -delete \\\n    && shellcheck --version\n"
                      ]
                    },
                    "platform": "linux/arm64"
                  }
                ],
                "platform": [
                  "linux/amd64",
                  "linux/arm64"
                ]
              }
            ],
            "properties": {
              "install_override": {
                "type": "array",
                "description": "Defines special installation steps for a specific platform (OS/CPU architecture/CPU variant), replacing the linter's install instructions given in the `install` node for this target platform only.",
                "items": {
                  "properties": {
                    "install": {
                      "description": "List of apk, dockerfile instructions, npm/pip/gem packages required to install the linter.\nThese special installation steps replace the instructions in the [`linters` > `install`](#linters_items_install) node when using this target platform pair only.",
                      "$ref": "#/properties/linters/items/properties/install"
                    },
                    "platform": {
                      "type": "string",
                      "$ref": "#/properties/linters/items/properties/supported_platforms/properties/platform/items",
                      "default": "linux/arm64",
                      "description": "Target platform (OS/CPU architecture/CPU variant) to define special installation steps for.",
                      "examples": []
                    }
                  },
                  "required": [
                    "platform",
                    "install"
                  ],
                  "type": "object"
                },
                "title": "Installation requirements override"
              },
              "platform": {
                "uniqueItems": true,
                "default": [
                  "linux/amd64"
                ],
                "description": "The list of target platforms (OS/CPU architecture/CPU Variant) that this linter supports.",
                "examples": [
                  [
                    "linux/amd64",
                    "linux/arm64"
                  ],
                  [
                    "linux/amd64"
                  ]
                ],
                "items": {
                  "default": "linux/amd64",
                  "description": "Target platforms [available to use on Docker](https://github.com/docker-library/bashbrew/blob/master/architecture/oci-platform.go#L16-L29).\n***Please note that Megalinter does not support all Docker's platforms.***",
                  "enum": [
                    "linux/amd64",
                    "linux/arm64",
                    "linux/arm/v7",
                    "linux/arm/v6",
                    "linux/arm/v5",
                    "linux/386",
                    "linux/mips64le",
                    "linux/ppc64le",
                    "linux/riscv64",
                    "linux/s390x",
                    "windows/amd64"
                  ],
                  "title": "Target platform",
                  "type": "string"
                },
                "title": "List of target platforms",
                "type": "array"
              }
            },
            "title": "Supported platforms"
          },
          "test_folder": {
            "type": "string",
            "description": "Test folder containing _good_ and _bad_ files, if different from parent descriptor test_folder",
            "examples": [
              [
                "bash_shfmt",
                "terraform_terrascan"
              ]
            ],
            "title": "Test folder in .automation/"
          },
          "test_format_fix_file_extensions": {
            "type": "array",
            "default": [],
            "description": "Format / Fix test file extension filters.",
            "examples": [
              [
                ".py",
                ""
              ]
            ],
            "items": {
              "type": "string"
            },
            "title": "Allowed file extensions"
          },
          "test_format_fix_regex_exclude": {
            "type": "string",
            "description": "Format / Fix test exclusions",
            "examples": [
              [
                "/bin/|/obj/"
              ]
            ],
            "title": "Format / Fix test exclusions"
          },
          "test_variables": {
            "type": "object",
            "description": "List of variables to set before running tests",
            "examples": [
              {
                "JAVASCRIPT_DEFAULT_STYLE": "prettier"
              }
            ],
            "title": "Test variables"
          },
          "variables": {
            "type": "array",
            "description": "Try to not use this property except if you really have no choice",
            "examples": [
              {
                "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"
              }
            ],
            "title": "Custom extra variables for the linter"
          },
          "version_command_return_code": {
            "type": "number",
            "title": "CLI version valid return code if different from 0"
          },
          "version_extract_regex": {
            "type": "string",
            "description": "If default regex to extract version from linter -v call, override it here",
            "examples": [
              "(?<=npm-groovy-lint version )\\d+(\\.\\d+)+"
            ],
            "title": "Regex to extract version"
          }
        },
        "required": [
          "linter_name",
          "linter_url",
          "examples"
        ],
        "additionalProperties": false
      },
      "title": "List of linters "
    },
    "processing_order": {
      "type": "number",
      "default": 0,
      "description": "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",
      "examples": [
        [
          -9,
          0,
          9
        ]
      ],
      "title": "Descriptor processing order"
    },
    "supported_platforms": {
      "type": "object",
      "default": {
        "platform": [
          "linux/amd64"
        ]
      },
      "description": "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](https://docs.docker.com/desktop/multi-arch/).",
      "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"
          ]
        }
      ],
      "properties": {
        "install_override": {
          "type": "array",
          "description": "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.",
          "items": {
            "properties": {
              "install": {
                "description": "List of apk, dockerfile instructions, npm/pip/gem packages required to use the descriptor's linters.\nThese special installation steps replace the instructions in the descriptor's [`install`](#install) node when using this target platform pair only.",
                "$ref": "#/properties/install"
              },
              "platform": {
                "type": "string",
                "$ref": "#/properties/supported_platforms/properties/platform/items",
                "default": "linux/arm64",
                "description": "Target platform (OS/CPU architecture/CPU variant) to define special installation steps for.",
                "examples": []
              }
            },
            "required": [
              "platform",
              "install"
            ],
            "type": "object"
          },
          "title": "Installation requirements override"
        },
        "platform": {
          "uniqueItems": true,
          "default": [
            "linux/amd64"
          ],
          "description": "The list of target platforms (OS/CPU architecture/CPU Variant) that this descriptor supports.",
          "examples": [
            [
              "linux/amd64",
              "linux/arm64"
            ],
            [
              "linux/amd64"
            ]
          ],
          "items": {
            "default": "linux/amd64",
            "description": "Target platforms [available to use on Docker](https://github.com/docker-library/bashbrew/blob/master/architecture/oci-platform.go#L16-L29).\n***Please note that Megalinter does not support all Docker's platforms.***",
            "enum": [
              "linux/amd64",
              "linux/arm64",
              "linux/arm/v7",
              "linux/arm/v6",
              "linux/arm/v5",
              "linux/386",
              "linux/mips64le",
              "linux/ppc64le",
              "linux/riscv64",
              "linux/s390x",
              "windows/amd64"
            ],
            "title": "Target platform",
            "type": "string"
          },
          "title": "List of target platforms",
          "type": "array"
        }
      },
      "title": "Supported platforms"
    },
    "test_folder": {
      "type": "string",
      "description": "Test folder containing _good_ and _bad_ files. Default: lowercase(descriptor_id)",
      "examples": [
        [
          "bash_shfmt",
          "terraform_terrascan"
        ]
      ],
      "title": "Test folder in .automation/"
    }
  },
  "additionalProperties": false,
  "required": [
    "descriptor_id",
    "descriptor_type",
    "linters"
  ],
  "$defs": {
    "command_info": {
      "description": "Command information",
      "properties": {
        "command": {
          "examples": [
            "npm run test",
            "echo \"This is a custom command\""
          ],
          "title": "Bash command to run",
          "type": "string"
        },
        "continue_if_failed": {
          "Description": "If command fails, continue MegaLinter process or not",
          "default": true,
          "title": "Continue if failed",
          "type": "boolean"
        },
        "cwd": {
          "enum": [
            "root",
            "workspace"
          ],
          "examples": [
            "root",
            "workspace"
          ],
          "title": "Folder where to run the command",
          "type": "string"
        }
      },
      "required": [],
      "title": "Command",
      "type": "object"
    },
    "enum_flavors": {
      "enum": [
        "all_flavors",
        "all",
        "c_cpp",
        "ci_light",
        "cupcake",
        "documentation",
        "dotnet",
        "dotnetweb",
        "formatters",
        "go",
        "java",
        "javascript",
        "php",
        "python",
        "ruby",
        "rust",
        "salesforce",
        "security",
        "swift",
        "terraform"
      ],
      "type": "string"
    },
    "linter_command_info": {
      "$ref": "#/$defs/command_info",
      "description": "Command information",
      "properties": {
        "run_after_linters": {
          "default": false,
          "title": "Process command after running linters",
          "type": "boolean"
        },
        "run_before_linters": {
          "default": false,
          "title": "Process command before running linters",
          "type": "boolean"
        }
      },
      "required": [],
      "title": "Command",
      "type": "object"
    }
  }
}
