{ "$id": "http://github.com/oxsecurity/megalinter-descriptor.json", "$schema": "http://json-schema.org/draft-07/schema", "additionalProperties": false, "definitions": { "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": "#/definitions/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" } }, "description": "Descriptor definition for MegaLinter", "properties": { "active_only_if_file_found": { "$id": "#/properties/active_only_if_file_found", "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", "type": "array" }, "descriptor_flavors": { "$id": "#/properties/descriptor_flavors", "default": [], "description": "MegaLinter flavors matching this descriptor", "examples": [ [ "all_flavors", "java", "php" ] ], "items": { "$ref": "#/definitions/enum_flavors" }, "title": "Flavors", "type": "array" }, "descriptor_flavors_exclude": { "$id": "#/properties/descriptor_flavors_exclude", "default": [], "description": "MegaLinter flavors that must not contain this descriptor", "examples": [ [ "all_flavors", "java", "php" ] ], "items": { "$ref": "#/definitions/enum_flavors" }, "title": "Flavors", "type": "array" }, "descriptor_id": { "$id": "#/properties/descriptor_id", "default": "", "description": "Uppercase unique identifier for the language, tooling format or identifier", "examples": [ "PYTHON", "XML", "OPENAPI" ], "title": "Descriptor unique identifier", "type": "string" }, "descriptor_label": { "$id": "#/properties/descriptor_label", "default": "", "description": "Label for descriptor documentation, if different from Id. Ex: C++ for CPP", "examples": [ "C++", "Visual Basic .NET" ], "title": "Descriptor label", "type": "string" }, "descriptor_type": { "$id": "#/properties/descriptor_type", "default": "", "description": "Descriptor type: language, format or tooling format", "enum": [ "language", "format", "tooling_format", "other" ], "examples": [ "language", "format", "tooling_format", "other" ], "title": "Descriptor type", "type": "string" }, "file_contains_regex": { "$id": "#/properties/file_contains_regex", "default": [], "description": "Regular expression list for filtering files by their content", "examples": [ [ "AWSTemplateFormatVersion", "(AWS|Alexa|Custom)::" ] ], "items": { "type": "string" }, "title": "File content regex filters", "type": "array" }, "file_contains_regex_extensions": { "$id": "#/properties/file_contains_regex_extensions", "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", "type": "array" }, "file_extensions": { "$id": "#/properties/file_extensions", "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", "type": "array" }, "file_names_not_ends_with": { "$id": "#/properties/file_names_not_ends_with", "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", "type": "array" }, "file_names_regex": { "$id": "#/properties/file_names_regex", "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", "type": "array" }, "files_sub_directory": { "$id": "#/properties/files_sub_directory", "description": "Set when a linter only lints a sub-directory", "examples": [ [ "ansible", "kubernetes" ] ], "title": "Files sub-directory", "type": "string" }, "install": { "$id": "#/properties/install", "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": { "$id": "#/properties/install/properties/apk", "description": "APK packages identifiers (with or without version)", "examples": [ [ "openjdk11" ] ], "items": { "$id": "#/properties/install/properties/apk/items", "type": "string" }, "title": "List of APK packages (Linux)", "type": "array" }, "apk_build": { "$id": "#/properties/install/properties/apk_build", "description": "APK packages needed only while pip/gem packages compile native extensions: installed as a virtual package during those steps and removed from the final image layers", "examples": [ [ "build-base", "re2-dev" ] ], "items": { "$id": "#/properties/install/properties/apk_build/items", "type": "string" }, "title": "List of build-time-only APK packages (Linux)", "type": "array" }, "cargo": { "$id": "#/properties/install/properties/cargo", "description": "Cargo packages identifiers (with or without version)", "items": { "$id": "#/properties/install/properties/cargo/items", "type": "string" }, "title": "List of Cargo packages (Rust)", "type": "array" }, "dockerfile": { "$id": "#/properties/install/properties/dockerfile", "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": { "$id": "#/properties/install/properties/dockerfile/items", "type": "string" }, "title": "List of Dockerfile instructions packages", "type": "array" }, "gem": { "$id": "#/properties/install/properties/gem", "description": "GEM packages identifiers (with or without version)", "items": { "$id": "#/properties/install/properties/gem/items", "type": "string" }, "title": "List of GEM packages (Ruby)", "type": "array" }, "npm": { "$id": "#/properties/install/properties/npm", "description": "NPM packages identifiers (with or without version)", "examples": [ [ "sfdx-cli" ] ], "items": { "$id": "#/properties/install/properties/npm/items", "type": "string" }, "title": "List of NPM packages (Node.js)", "type": "array" }, "pip": { "$id": "#/properties/install/properties/pip", "description": "PIP packages identifiers (with or without version)", "items": { "$id": "#/properties/install/properties/pip/items", "type": "string" }, "title": "List of PIP packages (Python)", "type": "array" } }, "title": "Installation requirements", "type": "object" }, "lint_all_files": { "$id": "#/properties/lint_all_files", "default": false, "description": "If set to true, this descriptor linters will always lint all files, undepending their name/extensions/content", "title": "Lint all files", "type": "boolean" }, "lint_all_other_linters_files": { "$id": "#/properties/lint_all_other_linters_files", "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", "type": "boolean" }, "linters": { "$id": "#/properties/linters", "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": { "$id": "#/properties/linters/items", "additionalProperties": false, "anyOf": [ { "required": [ "extends" ] }, { "required": [ "linter_url", "examples" ] } ], "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": { "$id": "#/properties/linters/items/properties/activation_rules", "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", "type": "array" }, "active_only_if_file_found": { "$id": "#/properties/linters/items/properties/active_only_if_file_found", "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", "type": "array" }, "can_output_sarif": { "$id": "#/properties/linters/items/properties/can_output_sarif", "default": false, "description": "Shows if the linter is capable of output SARIF report within MegaLinter", "title": "Can output SARIF", "type": "boolean" }, "class": { "$id": "#/properties/linters/items/properties/class", "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", "type": "string" }, "cli_config_arg_name": { "$id": "#/properties/linters/items/properties/cli_config_arg_name", "title": "CLI configuration file argument name if different from -c", "type": "string" }, "cli_config_default_value": { "$id": "#/properties/linters/items/properties/cli_config_default_value", "title": "Default value for config argument, in case it is not a file", "type": "string" }, "cli_config_extra_args": { "$id": "#/properties/linters/items/properties/cli_config_extra_args", "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", "type": "array" }, "cli_docker_args": { "$id": "#/properties/linters/items/properties/cli_docker_args", "default": [], "deprecated": true, "description": "DEPRECATED and ignored: running a linter via a sibling Docker image is no longer supported. Install the linter natively in the descriptor instead.", "examples": [ [ "-v", "`pwd`:`pwd`", "-w", "`pwd`" ] ], "items": { "type": "string" }, "title": "CLI docker run arguments (deprecated)", "type": "array" }, "cli_docker_image": { "$id": "#/properties/linters/items/properties/cli_docker_image", "deprecated": true, "description": "DEPRECATED and ignored: running a linter via a sibling Docker image is no longer supported. Install the linter natively in the descriptor instead.", "examples": [ "norionomura/swiftlint" ], "title": "Name of the docker image to use for linting (deprecated)", "type": "string" }, "cli_docker_image_version": { "$id": "#/properties/linters/items/properties/cli_docker_image_version", "default": "latest", "deprecated": true, "description": "DEPRECATED and ignored: running a linter via a sibling Docker image is no longer supported. Install the linter natively in the descriptor instead.", "examples": [ "0.42.0_swift-5.3.2" ], "title": "Docker image version (deprecated)", "type": "string" }, "cli_executable": { "$id": "#/properties/linters/items/properties/cli_executable", "description": "Override if different from linter_name", "title": "CLI executable for linting request", "type": "string" }, "cli_executable_help": { "$id": "#/properties/linters/items/properties/cli_executable_help", "description": "Override if different from cli executable used for linting", "title": "CLI executable for help request", "type": "string" }, "cli_executable_version": { "$id": "#/properties/linters/items/properties/cli_executable_version", "description": "Override if different from cli executable used for linting", "title": "CLI executable for version request", "type": "string" }, "cli_help_arg_name": { "$id": "#/properties/linters/items/properties/cli_help_arg_name", "title": "CLI Help argument name if different from -h", "type": "string" }, "cli_help_extra_args": { "$id": "#/properties/linters/items/properties/cli_help_extra_args", "description": "When linter CLI is call for help, send these additional arguments", "items": { "type": "string" }, "title": "CLI help extra arguments", "type": "array" }, "cli_help_extra_commands": { "$id": "#/properties/linters/items/properties/cli_help_extra_commands", "description": "When linter CLI is call for help, send these additional commands", "items": { "type": "string" }, "title": "CLI help extra commands", "type": "array" }, "cli_lint_errors_count": { "$id": "#/properties/linters/items/properties/cli_lint_errors_count", "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", "type": "string" }, "cli_lint_errors_regex": { "$id": "#/properties/linters/items/properties/cli_lint_errors_regex", "description": "Regex allowing to extract the number of errors from linter output logs", "examples": [ "Issues found: (.*) in .* files" ], "title": "Lint errors number regex", "type": "string" }, "cli_lint_extra_args": { "$id": "#/properties/linters/items/properties/cli_lint_extra_args", "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)", "type": "array" }, "cli_lint_extra_args_after": { "$id": "#/properties/linters/items/properties/cli_lint_extra_args_after", "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)", "type": "array" }, "cli_lint_fix_arg_name": { "$id": "#/properties/linters/items/properties/cli_lint_fix_arg_name", "examples": [ "--fix", "--format" ], "title": "If the linter can format or fix, input here the related triggering argument", "type": "string" }, "cli_lint_fix_remove_args": { "$id": "#/properties/linters/items/properties/cli_lint_fix_remove_args", "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", "type": "array" }, "cli_lint_ignore_arg_name": { "$id": "#/properties/linters/items/properties/cli_lint_ignore_arg_name", "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", "type": "string" }, "cli_lint_mode": { "$id": "#/properties/linters/items/properties/cli_lint_mode", "default": "file", "description": "Defines how the linter is called: file, list_of_files, project", "enum": [ "file", "project", "list_of_files" ], "title": "Linting mode", "type": "string" }, "cli_lint_mode_file_extra_args_after": { "$id": "#/properties/linters/items/properties/cli_lint_mode_file_extra_args_after", "default": [], "description": "When linter CLI is call for linting on file lint mode, send these additional arguments after config args", "items": { "type": "string" }, "title": "CLI Lint extra arguments (after config args)", "type": "array" }, "cli_lint_mode_list_of_files_extra_args_after": { "$id": "#/properties/linters/items/properties/cli_lint_mode_list_of_files_extra_args_after", "default": [], "description": "When linter CLI is call for linting on list_of_files lint mode, send these additional arguments after config args", "items": { "type": "string" }, "title": "CLI Lint extra arguments (after config args)", "type": "array" }, "cli_lint_mode_project_exclude_arg_name": { "$id": "#/properties/linters/items/properties/cli_lint_mode_project_exclude_arg_name", "description": "Native linter CLI argument used to forward each excluded directory (EXCLUDED_DIRECTORIES + ADDITIONAL_EXCLUDED_DIRECTORIES) when running in project lint mode. If it ends with = or :, the value is concatenated to the argument name", "examples": [ "--skip-dirs", "--exclude", "--ignore=" ], "title": "CLI project lint mode excluded directories argument name", "type": "string" }, "cli_lint_mode_project_exclude_arg_value": { "$id": "#/properties/linters/items/properties/cli_lint_mode_project_exclude_arg_value", "default": "{{DIR}}", "description": "Template used to build the value sent with cli_lint_mode_project_exclude_arg_name for each excluded directory. {{DIR}} is replaced by the directory name, matched by the linter at any nesting level. Use {{DIR_PATH}} instead when the linter anchors its patterns on the workspace root: it is replaced by each workspace-relative path where the directory was found", "examples": [ "{{DIR}}", "./{{DIR}}/**", "**/{{DIR}}/**", "./{{DIR_PATH}}" ], "title": "CLI project lint mode excluded directories argument value template", "type": "string" }, "cli_lint_mode_project_exclude_config_key": { "$id": "#/properties/linters/items/properties/cli_lint_mode_project_exclude_config_key", "description": "Dotted key path of the resolved config file list that the exclusion argument replaces: its entries are re-emitted first so they are preserved", "examples": [ "skip-path", "exclude", "scan.skip-dirs" ], "title": "CLI project lint mode excluded directories config list key", "type": "string" }, "cli_lint_mode_project_exclude_ignore_file_arg_name": { "$id": "#/properties/linters/items/properties/cli_lint_mode_project_exclude_ignore_file_arg_name", "description": "CLI argument receiving a generated ignore file that forwards excluded directories in project lint mode", "examples": [ "--ignore-path", "--ignorePath" ], "title": "CLI project lint mode generated ignore file argument name", "type": "string" }, "cli_lint_mode_project_exclude_ignore_file_pass_existing": { "$id": "#/properties/linters/items/properties/cli_lint_mode_project_exclude_ignore_file_pass_existing", "default": [], "description": "Workspace files re-passed through the same argument before the generated ignore file, when the argument replaces their default discovery", "examples": [ [ ".gitignore", ".prettierignore" ] ], "items": { "type": "string" }, "title": "CLI project lint mode ignore files re-passed alongside the generated one", "type": "array" }, "cli_lint_mode_project_exclude_ignore_file_seed_files": { "$id": "#/properties/linters/items/properties/cli_lint_mode_project_exclude_ignore_file_seed_files", "default": [], "description": "Workspace files whose lines seed the generated ignore file (first existing file wins)", "examples": [ [ ".csharpierignore" ] ], "items": { "type": "string" }, "title": "CLI project lint mode generated ignore file seed files", "type": "array" }, "cli_lint_mode_project_exclude_seed_values": { "$id": "#/properties/linters/items/properties/cli_lint_mode_project_exclude_seed_values", "default": [], "description": "Default values re-included before the excluded directories when the linter's exclusion argument replaces its built-in defaults", "examples": [ [ "**/.git/**", "**/bin/**" ] ], "items": { "type": "string" }, "title": "CLI project lint mode excluded directories seed values", "type": "array" }, "cli_lint_mode_project_exclude_separator": { "$id": "#/properties/linters/items/properties/cli_lint_mode_project_exclude_separator", "description": "When set, all excluded directory values are joined with this separator and sent as a single argument occurrence, instead of repeating the argument for each directory", "examples": [ ",", "|" ], "title": "CLI project lint mode excluded directories separator", "type": "string" }, "cli_lint_mode_project_extra_args_after": { "$id": "#/properties/linters/items/properties/cli_lint_mode_project_extra_args_after", "default": [], "description": "When linter CLI is call for linting on project lint mode, send these additional arguments after config args", "items": { "type": "string" }, "title": "CLI Lint extra arguments (after config args)", "type": "array" }, "cli_lint_warnings_count": { "$id": "#/properties/linters/items/properties/cli_lint_warnings_count", "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", "type": "string" }, "cli_lint_warnings_regex": { "$id": "#/properties/linters/items/properties/cli_lint_warnings_regex", "description": "Regex allowing to extract the number of warnings from linter output logs", "examples": [ "Issues found: (.*) in .* files" ], "title": "Lint warnings number regex", "type": "string" }, "cli_sarif_args": { "$id": "#/properties/linters/items/properties/cli_sarif_args", "default": [], "description": "Arguments to generate SARIF output", "examples": [ [ "--format", "sarif", "--output", "{{SARIF_OUTPUT_FILE}}" ] ], "items": { "type": "string" }, "title": "CLI SARIF run arguments", "type": "array" }, "cli_version_arg_name": { "$id": "#/properties/linters/items/properties/cli_version_arg_name", "title": "CLI version argument name if different from -v", "type": "string" }, "cli_version_extra_args": { "$id": "#/properties/linters/items/properties/cli_version_extra_args", "description": "When linter CLI is call for version, send these additional arguments", "items": { "type": "string" }, "title": "CLI Version extra arguments", "type": "array" }, "common_linter_errors": { "$id": "#/properties/linters/items/properties/common_linter_errors", "description": "Patterns matched against a non-successful linter output to surface known non-lint failures (config issue, remote service down, missing credentials, etc.) with a guidance message. Does not affect exit code or error counts.", "items": { "additionalProperties": false, "properties": { "identifier": { "pattern": "^[A-Z][A-Z0-9_]*_ERROR_[A-Z0-9_]+$", "title": "Stable identifier for this known error. Must start with the linter key followed by _ERROR_ (e.g. ACTION_ZIZMOR_ERROR_GITHUB_API_UNREACHABLE).", "type": "string" }, "message": { "title": "Explanation and resolution shown to the user when the regex matches", "type": "string" }, "regex": { "title": "Pattern matched against linter stdout (Python re.search)", "type": "string" } }, "required": [ "identifier", "regex", "message" ], "type": "object" }, "title": "Known non-lint error patterns with user guidance", "type": "array" }, "config_file_name": { "$id": "#/properties/linters/items/properties/config_file_name", "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", "type": "string" }, "deprecated": { "$id": "#/properties/linters/items/properties/deprecated", "default": false, "description": "Shows if the linter is deprecated.", "title": "Is the linter deprecated?", "type": "boolean" }, "deprecated_description": { "$id": "#/properties/linters/items/properties/deprecated_description", "default": "", "description": "Displays information on why it is deprecated and whether an alternative is available.", "title": "Description of the deprecated linter", "type": "string" }, "descriptor_flavors": { "$id": "#/properties/linters/items/properties/descriptor_flavors", "default": [], "description": "MegaLinter flavors matching this linter", "examples": [ [ "all_flavors", "java", "php" ] ], "items": { "$ref": "#/definitions/enum_flavors" }, "title": "Flavors", "type": "array" }, "descriptor_flavors_exclude": { "$id": "#/properties/linters/items/properties/descriptor_flavors_exclude", "default": [], "description": "MegaLinter flavors that must not contain this descriptor", "examples": [ [ "all_flavors", "java", "php" ] ], "items": { "$ref": "#/definitions/enum_flavors" }, "title": "Flavors", "type": "array" }, "disabled": { "$id": "#/properties/linters/items/properties/disabled", "default": false, "description": "Disable linter in MegaLinter next builds", "title": "Disabled", "type": "boolean" }, "disabled_reason": { "$id": "#/properties/linters/items/properties/disabled_reason", "default": false, "description": "Explanation about why the linter is disabled", "title": "Disabled reason", "type": "string" }, "downgraded_reason": { "$id": "#/properties/linters/items/properties/downgraded_reason", "default": false, "description": "Explanation about why the linter is downgraded", "title": "Downgraded reason", "type": "string" }, "downgraded_version": { "$id": "#/properties/linters/items/properties/downgraded_version", "default": false, "description": "Indicates that installation instructions does not use the latest release of the linter", "title": "Downgraded version", "type": "boolean" }, "examples": { "$id": "#/properties/linters/items/properties/examples", "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", "type": "array" }, "extends": { "$id": "#/properties/linters/items/properties/extends", "description": "Name of a shared linter definition file located in megalinter/descriptors/shared/.megalinter-linter.yml. Properties defined in the descriptor linter entry override the shared ones (shallow merge, no chaining)", "examples": [ "eslint", "prettier" ], "title": "Shared linter definition to extend", "type": "string" }, "file_extensions": { "$id": "#/properties/linters/items/file_extensions", "default": [], "description": "File extension filters if different from the ones defined on parent descriptor", "examples": [ [ ".py", "" ] ], "items": { "type": "string" }, "title": "Allowed file extensions", "type": "array" }, "file_names_not_ends_with": { "$id": "#/properties/linters/items/file_names_not_ends_with", "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", "type": "array" }, "file_names_regex": { "$id": "#/properties/linters/items/file_names_regex", "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", "type": "array" }, "files_separator": { "$id": "#/properties/linters/items/properties/files_separator", "description": "Separator used to split file paths in the linter command", "examples": [ "," ], "title": "Files separator", "type": "string" }, "files_sub_directory": { "$id": "#/properties/linters/items/files_sub_directory", "description": "Set when a linter only lints a sub-directory", "examples": [ [ "ansible", "kubernetes" ] ], "title": "Files sub-directory", "type": "string" }, "help_command_return_code": { "$id": "#/properties/linters/items/properties/help_command_return_code", "title": "CLI Help valid return code if different from 0", "type": "number" }, "ide": { "$id": "#/properties/linters/items/properties/ide", "description": "List of IDE supporting the linter", "title": "IDE Integration", "type": "object" }, "ignore_file_name": { "$id": "#/properties/linters/items/properties/ignore_file_name", "description": "An explanation about the purpose of this instance.", "examples": [ ".eslintignore", ".secretlintignore" ], "title": "Default file name for the linter ignore file", "type": "string" }, "ignore_for_flavor_suggestions": { "$id": "#/properties/linters/items/properties/ignore_for_flavor_suggestions", "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", "type": "boolean" }, "install": { "$id": "#/properties/linters/items/properties/install", "default": {}, "description": "List of apk, dockerfile instructions, npm/pip/gem packages required to install the linter", "examples": [ { "dockerfile": [ "FROM ghcr.io/betterleaks/betterleaks:latest AS betterleaks", "COPY --from=betterleaks /usr/bin/betterleaks /usr/bin/", "RUN betterleaks version" ] }, { "npm": [ "eslint", "eslint-config-airbnb", "eslint-config-prettier", "eslint-plugin-jest", "eslint-plugin-prettier", "babel-eslint" ] } ], "properties": { "apk": { "$id": "#/properties/linters/items/properties/install/properties/apk", "description": "APK packages identifiers (with or without version)", "examples": [ [ "perl", "perl-dev" ] ], "items": { "$id": "#/properties/linters/items/properties/install/properties/apk/items", "type": "string" }, "title": "List of APK packages (Linux)", "type": "array" }, "apk_build": { "$id": "#/properties/linters/items/properties/install/properties/apk_build", "description": "APK packages needed only while pip/gem packages compile native extensions: installed as a virtual package during those steps and removed from the final image layers", "examples": [ [ "build-base", "re2-dev" ] ], "items": { "$id": "#/properties/linters/items/properties/install/properties/apk_build/items", "type": "string" }, "title": "List of build-time-only APK packages (Linux)", "type": "array" }, "cargo": { "$id": "#/properties/linters/items/properties/install/properties/cargo", "description": "Cargo packages identifiers (with or without version)", "examples": [ [ "clippy", "sarif-fmt" ] ], "items": { "$id": "#/properties/linters/items/properties/install/properties/cargo/items", "type": "string" }, "title": "List of Cargo packages (Rust)", "type": "array" }, "dockerfile": { "$id": "#/properties/linters/items/properties/install/properties/dockerfile", "description": "Will be automatically integrated in generated Dockerfile", "examples": [ [ "FROM ghcr.io/betterleaks/betterleaks:latest AS betterleaks", "COPY --from=betterleaks /usr/bin/betterleaks /usr/bin/", "RUN betterleaks version" ] ], "items": { "$id": "#/properties/linters/items/properties/install/properties/dockerfile/items", "type": "string" }, "title": "List of Dockerfile instructions packages", "type": "array" }, "gem": { "$id": "#/properties/linters/items/properties/install/properties/gem", "description": "GEM packages identifiers (with or without version)", "examples": [ [ "rubocop:0.82.0", "rubocop-github:0.16.0", "rubocop-performance" ] ], "items": { "$id": "#/properties/linters/items/properties/install/properties/gem/items", "type": "string" }, "title": "List of GEM packages (Ruby)", "type": "array" }, "npm": { "$id": "#/properties/linters/items/properties/install/properties/npm", "description": "NPM packages identifiers (with or without version)", "examples": [ [ "eslint", "eslint-config-airbnb@3.2.1" ] ], "items": { "$id": "#/properties/linters/items/properties/install/properties/npm/items", "type": "string" }, "title": "List of NPM packages (Node.js)", "type": "array" }, "pip": { "$id": "#/properties/linters/items/properties/install/properties/pip", "description": "PIP packages identifiers (with or without version)", "examples": [ [ "flake8" ] ], "items": { "$id": "#/properties/linters/items/properties/install/properties/pip/items", "type": "string" }, "title": "List of PIP packages (Python)", "type": "array" } }, "title": "Installation requirements", "type": "object" }, "is_formatter": { "$id": "#/properties/linters/items/properties/is_formatter", "default": false, "description": "If the linter is just a formatter, set to true so errors will count as warnings", "title": "Is formatter", "type": "boolean" }, "is_sbom": { "$id": "#/properties/linters/items/properties/is_sbom", "default": false, "description": "If the linter is SBOM, set to true so extra properties will be returned", "title": "Is SBOM", "type": "boolean" }, "lint_all_files": { "$id": "#/properties/linters/items/lint_all_files", "default": false, "description": "If set to true, this linter will always lint all files, undepending their name/extensions/content", "title": "Lint all files", "type": "boolean" }, "lint_all_other_linters_files": { "$id": "#/properties/linters/items/lint_all_other_linters_files", "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", "type": "boolean" }, "linter_banner_image_url": { "$id": "#/properties/linters/items/properties/linter_banner_image_url", "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", "type": "string" }, "linter_help_cache": { "$id": "#/properties/linters/items/properties/linter_help_cache", "description": "If the linter is unable to return help content, hardcode it here", "title": "Hardcoded help content", "type": "string" }, "linter_icon_png_url": { "$id": "#/properties/linters/items/properties/linter_icon_png_url", "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", "type": "string" }, "linter_image_url": { "$id": "#/properties/linters/items/properties/linter_image_url", "description": "URL of an image used in linter Markdown documentation", "examples": [ "https://raku.org/camelia-logo.png" ], "format": "uri", "title": "Linter image URL", "type": "string" }, "linter_megalinter_ref_url": { "$id": "#/properties/linters/items/properties/linter_megalinter_ref_url", "description": "URL to linter documentation referring to MegaLinter", "title": "MegaLinter reference URL", "type": "string" }, "linter_name": { "$id": "#/properties/linters/items/properties/linter_name", "description": "Name of the linter (same as cli command if possible)", "examples": [ "eslint" ], "title": "Linter name", "type": "string" }, "linter_repo": { "$id": "#/properties/linters/items/properties/linter_repo", "description": "URL of the linter repository home page", "examples": [ "https://github.com/eslint/eslint" ], "format": "uri", "title": "Linter URL", "type": "string" }, "linter_rules_configuration_url": { "$id": "#/properties/linters/items/properties/linter_rules_configuration_url", "description": "URL to linter documentation explaining how to configure the linter", "format": "uri", "title": "Linter rules configuration URL", "type": "string" }, "linter_rules_ignore_config_url": { "$id": "#/properties/linters/items/properties/linter_rules_ignore_config_url", "description": "URL to linter documentation explaining how to ignore files", "format": "uri", "title": "Linter rules ignore config URL", "type": "string" }, "linter_rules_inline_disable_url": { "$id": "#/properties/linters/items/properties/linter_rules_inline_disable_url", "description": "URL to linter documentation explaining how to disable rules directly with comments in files", "format": "uri", "title": "Linter rules inline disable URL", "type": "string" }, "linter_rules_url": { "$id": "#/properties/linters/items/properties/linter_rules_url", "description": "URL to linter documentation listing all the rules that can be detected", "format": "uri", "title": "Linter rules URL", "type": "string" }, "linter_spdx_license": { "$id": "#/properties/linters/items/properties/linter_spdx_license", "description": "spdx license id of the linter", "title": "spdx license", "type": "string" }, "linter_speed": { "$id": "#/properties/linters/items/properties/linter_speed", "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", "type": "number" }, "linter_text": { "$id": "#/properties/linters/items/properties/linter_text", "title": "Additional text for MegaLinter online documentation", "type": "string" }, "linter_url": { "$id": "#/properties/linters/items/properties/linter_url", "description": "URL of the linter home page", "examples": [ "https://eslint.org" ], "format": "uri", "title": "Linter URL", "type": "string" }, "linter_version_cache": { "$id": "#/properties/linters/items/properties/linter_version_cache", "description": "If the linter is unable to return a version number, hardcode it here", "title": "Hardcoded version number", "type": "string" }, "name": { "$id": "#/properties/linters/items/properties/name", "description": "When several linters in a descriptor, set a different name that will be used for configuration", "examples": [ "JAVASCRIPT_ES" ], "title": "Linter configuration key", "type": "string" }, "post_commands": { "$id": "#/properties/linters/items/properties/post_commands", "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": "#/definitions/linter_command_info" }, "title": "Linter Pre-run commands", "type": "array" }, "pre_commands": { "$id": "#/properties/linters/items/properties/pre_commands", "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": "#/definitions/linter_command_info" }, "title": "Linter Pre-run commands", "type": "array" }, "sarif_default_output_file": { "$id": "#/properties/linters/items/sarif_default_output_file", "description": "Path to find default SARIF output file when generated by linter", "examples": [ [ "./results.sarif" ] ], "title": "SARIF default output file", "type": "string" }, "supported_cli_lint_modes": { "$id": "#/properties/linters/items/properties/supported_cli_lint_modes", "default": [ "file" ], "description": "Define the possible ways in which a linter can be called: file, list_of_files, project", "examples": [ [ "file", "list_of_files" ], [ "project" ] ], "items": { "default": "file", "enum": [ "file", "project", "list_of_files" ], "title": "Linting mode", "type": "string" }, "title": "Linting modes", "type": "array", "uniqueItems": true }, "supported_platforms": { "$id": "#/properties/linters/items/properties/supported_platforms", "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": { "$id": "#/properties/linters/items/properties/supported_platforms/properties/install_override", "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": { "$id": "#/properties/linters/items/properties/supported_platforms/properties/install_override/items/properties/install", "$ref": "#/properties/linters/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." }, "platform": { "$id": "#/properties/linters/items/properties/supported_platforms/properties/install_override/items/properties/platform", "$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": [], "type": "string" } }, "required": [ "platform", "install" ], "type": "object" }, "title": "Installation requirements override", "type": "array" }, "platform": { "$id": "#/properties/linters/items/properties/supported_platforms/properties/platform", "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", "uniqueItems": true } }, "title": "Supported platforms", "type": "object" }, "test_folder": { "$id": "#/properties/linters/items/test_folder", "description": "Test folder containing _good_ and _bad_ files, if different from parent descriptor test_folder", "examples": [ [ "bash_shfmt", "terraform_tflint" ] ], "title": "Test folder in .automation/", "type": "string" }, "test_format_fix_file_extensions": { "$id": "#/properties/test_format_fix_file_extensions", "default": [], "description": "Format / Fix test file extension filters.", "examples": [ [ ".py", "" ] ], "items": { "type": "string" }, "title": "Allowed file extensions", "type": "array" }, "test_format_fix_regex_exclude": { "$id": "#/properties/linters/items/test_format_fix_regex_exclude", "description": "Format / Fix test exclusions", "examples": [ [ "/bin/|/obj/" ] ], "title": "Format / Fix test exclusions", "type": "string" }, "test_variables": { "$id": "#/properties/linters/items/properties/test_variables", "description": "List of variables to set before running tests", "examples": [ { "JAVASCRIPT_DEFAULT_STYLE": "prettier" } ], "title": "Test variables", "type": "object" }, "variables": { "$id": "#/properties/linters/items/properties/variables", "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", "type": "array" }, "version_command_return_code": { "$id": "#/properties/linters/items/properties/version_command_return_code", "title": "CLI version valid return code if different from 0", "type": "number" }, "version_extract_regex": { "$id": "#/properties/linters/items/properties/version_extract_regex", "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", "type": "string" } }, "required": [ "linter_name" ], "title": "Linter definition", "type": "object" }, "title": "List of linters ", "type": "array" }, "processing_order": { "$id": "#/properties/processing_order", "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", "type": "number" }, "supported_platforms": { "$id": "#/properties/supported_platforms", "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": { "$id": "#/properties/supported_platforms/properties/install_override", "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": { "$id": "#/properties/supported_platforms/properties/install_override/items/properties/install", "$ref": "#/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." }, "platform": { "$id": "#/properties/supported_platforms/properties/install_override/items/properties/platform", "$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": [], "type": "string" } }, "required": [ "platform", "install" ], "type": "object" }, "title": "Installation requirements override", "type": "array" }, "platform": { "$id": "#/properties/supported_platforms/properties/platform", "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", "uniqueItems": true } }, "title": "Supported platforms", "type": "object" }, "test_folder": { "$id": "#/properties/test_folder", "description": "Test folder containing _good_ and _bad_ files. Default: lowercase(descriptor_id)", "examples": [ [ "bash_shfmt", "terraform_tflint" ] ], "title": "Test folder in .automation/", "type": "string" } }, "required": [ "descriptor_id", "descriptor_type", "linters" ], "title": "MegaLinter descriptor", "type": "object" }