diff --git a/.automation/build.py b/.automation/build.py
index 9850f041b0f..6a918bfd9e6 100644
--- a/.automation/build.py
+++ b/.automation/build.py
@@ -118,6 +118,17 @@
"vscode": {"label": "Visual Studio Code", "url": "https://code.visualstudio.com/"},
}
+DEPRECATED_LINTERS = [
+ "CREDENTIALS_SECRETLINT", # Removed in v6
+ "DOCKERFILE_DOCKERFILELINT", # Removed in v6
+ "GIT_GIT_DIFF", # Removed in v6
+ "PHP_BUILTIN", # Removed in v6
+ "KUBERNETES_KUBEVAL", # Removed in v7
+ "REPOSITORY_GOODCHECK", # Removed in v7
+ "SPELL_MISSPELL", # Removed in v7
+ "TERRAFORM_CHECKOV", # Removed in v7
+]
+
DESCRIPTORS_FOR_BUILD_CACHE = None
@@ -1135,7 +1146,9 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
linter_doc_md += [f"# {linter.linter_name}\n{md_individual_extra}"]
# Indicate that a linter is disabled in this version
+ title_prefix = ""
if hasattr(linter, "deprecated") and linter.deprecated is True:
+ title_prefix = "(deprecated) "
linter_doc_md += [""]
linter_doc_md += ["> This linter has been deprecated.", ">"]
@@ -1314,7 +1327,7 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
{
"$id": f"#/properties/{linter.name}_FILTER_REGEX_INCLUDE",
"type": "string",
- "title": f"{linter.name}: Including Regex",
+ "title": f"{title_prefix}{linter.name}: Including Regex",
},
],
[
@@ -1322,7 +1335,7 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
{
"$id": f"#/properties/{linter.name}_FILTER_REGEX_EXCLUDE",
"type": "string",
- "title": f"{linter.name}: Excluding Regex",
+ "title": f"{title_prefix}{linter.name}: Excluding Regex",
},
],
]
@@ -1362,7 +1375,7 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
{
"$id": f"#/properties/{linter.name}_CLI_LINT_MODE",
"type": "string",
- "title": f"{linter.name}: Override default cli lint mode",
+ "title": f"{title_prefix}{linter.name}: Override default cli lint mode",
"default": linter.cli_lint_mode,
"enum": enum,
},
@@ -1395,7 +1408,10 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
{
"$id": f"#/properties/{linter.name}_FILE_EXTENSIONS",
"type": "array",
- "title": f"{linter.name}: Override descriptor/linter matching files extensions",
+ "title": (
+ title_prefix
+ + f"{linter.name}: Override descriptor/linter matching files extensions"
+ ),
"examples:": [".py", ".myext"],
"items": {"type": "string"},
},
@@ -1405,7 +1421,10 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
{
"$id": f"#/properties/{linter.name}_FILE_NAMES_REGEX",
"type": "array",
- "title": f"{linter.name}: Override descriptor/linter matching file name regex",
+ "title": (
+ title_prefix
+ + f"{linter.name}: Override descriptor/linter matching file name regex"
+ ),
"examples": ["Dockerfile(-.+)?", "Jenkinsfile"],
"items": {"type": "string"},
},
@@ -1430,7 +1449,7 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
{
"$id": f"#/properties/{linter.name}_ARGUMENTS",
"type": ["array", "string"],
- "title": f"{linter.name}: Custom arguments",
+ "title": f"{title_prefix}{linter.name}: Custom arguments",
"description": f"{linter.name}: User custom arguments to add in linter CLI call",
"examples:": ["--foo", "bar"],
"items": {"type": "string"},
@@ -1441,7 +1460,10 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
{
"$id": f"#/properties/{linter.name}_PRE_COMMANDS",
"type": "array",
- "title": f"{linter.name}: Define or override a list of bash commands to run before the linter",
+ "title": (
+ title_prefix
+ + f"{linter.name}: Define or override a list of bash commands to run before the linter"
+ ),
"examples": [
[
{
@@ -1459,7 +1481,10 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
{
"$id": f"#/properties/{linter.name}_POST_COMMANDS",
"type": "array",
- "title": f"{linter.name}: Define or override a list of bash commands to run after the linter",
+ "title": (
+ title_prefix
+ + f"{linter.name}: Define or override a list of bash commands to run after the linter"
+ ),
"examples": [
[
{
@@ -1478,7 +1503,10 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
"$id": f"#/properties/{linter.name}_DISABLE_ERRORS",
"type": "boolean",
"default": False,
- "title": f"{linter.name}: Linter doesn't make MegaLinter fail even if errors are found",
+ "title": (
+ title_prefix
+ + f"{linter.name}: Linter doesn't make MegaLinter fail even if errors are found"
+ ),
},
],
[
@@ -1487,7 +1515,7 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
"$id": f"#/properties/{linter.name}_DISABLE_ERRORS_IF_LESS_THAN",
"type": "number",
"default": 0,
- "title": f"{linter.name}: Maximum number of errors allowed",
+ "title": f"{title_prefix}{linter.name}: Maximum number of errors allowed",
},
],
[
@@ -1496,7 +1524,7 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
"$id": f"#/properties/{linter.name}_CLI_EXECUTABLE",
"type": "array",
"default": [linter.cli_executable],
- "title": f"{linter.name}: CLI Executable",
+ "title": f"{title_prefix}{linter.name}: CLI Executable",
"items": {"type": "string"},
},
],
@@ -1518,7 +1546,7 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
{
"$id": f"#/properties/{linter.name}_CONFIG_FILE",
"type": "string",
- "title": f"{linter.name}: Custom config file name",
+ "title": f"{title_prefix}{linter.name}: Custom config file name",
"default": linter.config_file_name,
"description": f"{linter.name}: User custom config file name if different from default",
},
@@ -1528,7 +1556,7 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
{
"$id": f"#/properties/{linter.name}_RULES_PATH",
"type": "string",
- "title": f"{linter.name}: Custom config file path",
+ "title": f"{title_prefix}{linter.name}: Custom config file path",
"description": f"{linter.name}: Path where to find linter configuration file",
},
],
@@ -1556,7 +1584,7 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
{
"$id": f"#/properties/{linter.name}_DIRECTORY",
"type": "string",
- "title": f"{linter.name}: Directory containing {linter.descriptor_id} files",
+ "title": f"{title_prefix}{linter.name}: Directory containing {linter.descriptor_id} files",
"default": linter.files_sub_directory,
},
],
@@ -2252,14 +2280,22 @@ def move_to_file(file_path, start, end, target_file, keep_in_source=False):
with open(file_path, "w", encoding="utf-8") as file:
file.write(file_content)
logging.info("Updated " + file.name + " between " + start + " and " + end)
- bracket_content = (
- bracket_content.replace("####", "#THREE#")
- .replace("###", "#TWO#")
- .replace("##", "#ONE#")
- .replace("#THREE#", "###")
- .replace("#TWO#", "##")
- .replace("#ONE#", "#")
- )
+ if ""
@@ -2291,7 +2327,14 @@ def replace_anchors_by_links(file_path, moves):
["formats", "supported-linters.md#formats"],
["tooling-formats", "supported-linters.md#tooling-formats"],
["other", "supported-linters.md#other"],
- ["apply-fixes", "configuration.md#apply-fixes"],
+ ["apply-fixes", "config-apply-fixes.md"],
+ ["installation", "install-assisted.md"],
+ ["configuration", "config-file.md"],
+ ["activation-and-deactivation", "config-activation.md"],
+ ["filter-linted-files", "config-filtering.md"],
+ ["pre-commands", "config-precommands.md"],
+ ["post-commands", "config-postcommands.md"],
+ ["environment-variables-security", "config-variables-security.md"],
]:
file_content_new = file_content_new.replace(f"(#{pair[0]})", f"({pair[1]})")
if file_content_new != file_content:
@@ -2357,8 +2400,27 @@ def finalize_doc_build():
# 'format',
# 'tooling-formats',
# 'other',
- "installation",
- "configuration",
+ "install-assisted",
+ "install-version",
+ "install-github",
+ "install-gitlab",
+ "install-azure",
+ "install-bitbucket",
+ "install-jenkins",
+ "install-concourse",
+ "install-drone",
+ "install-docker",
+ "install-locally",
+ "config-file",
+ "config-variables",
+ "config-activation",
+ "config-filtering",
+ "config-apply-fixes",
+ "config-linters",
+ "config-precommands",
+ "config-postcommands",
+ "config-variables-security",
+ "config-cli-lint-mode",
"reporters",
"flavors",
"badge",
@@ -2420,6 +2482,18 @@ def finalize_doc_build():
"",
"",
)
+ replace_in_file(
+ target_file,
+ "",
+ "",
+ "",
+ )
+ replace_in_file(
+ target_file,
+ "",
+ "",
+ "",
+ )
# Remove link to online doc
replace_in_file(
target_file,
@@ -2523,16 +2597,7 @@ def generate_json_schema_enums():
json_schema["definitions"]["enum_descriptor_keys"]["enum"] += ["CREDENTIALS", "GIT"]
json_schema["definitions"]["enum_linter_keys"]["enum"] = [x.name for x in linters]
# Deprecated linters
- json_schema["definitions"]["enum_linter_keys"]["enum"] += [
- "CREDENTIALS_SECRETLINT", # Removed in v6
- "DOCKERFILE_DOCKERFILELINT", # Removed in v6
- "GIT_GIT_DIFF", # Removed in v6
- "PHP_BUILTIN", # Removed in v6
- "KUBERNETES_KUBEVAL", # Removed in v7
- "REPOSITORY_GOODCHECK", # Removed in v7
- "SPELL_MISSPELL", # Removed in v7
- "TERRAFORM_CHECKOV", # Removed in v7
- ]
+ json_schema["definitions"]["enum_linter_keys"]["enum"] += DEPRECATED_LINTERS
with open(CONFIG_JSON_SCHEMA, "w", encoding="utf-8") as outfile:
json.dump(json_schema, outfile, indent=2, sort_keys=True)
outfile.write("\n")
diff --git a/.cspell.json b/.cspell.json
index 40b636f572b..c553575821b 100644
--- a/.cspell.json
+++ b/.cspell.json
@@ -962,11 +962,13 @@
"pnpm",
"poptabs",
"posix",
+ "postcommands",
"posteriori",
"postgres",
"postvalid",
"prantlf",
"precommand",
+ "precommands",
"preemptible",
"preid",
"premption",
diff --git a/.mega-linter.yml b/.mega-linter.yml
index feb0f3a6d01..ac3a80f3d5a 100644
--- a/.mega-linter.yml
+++ b/.mega-linter.yml
@@ -16,6 +16,7 @@ DISABLE_LINTERS:
- JSON_PRETTIER
- REPOSITORY_GITLEAKS
- SPELL_PROSELINT
+ - SPELL_MISSPELL
DISABLE_ERRORS_LINTERS:
- PYTHON_BANDIT
- PYTHON_PYRIGHT
diff --git a/CHANGELOG.md b/CHANGELOG.md
index be8d30b5878..04ecad0eabd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -67,6 +67,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
- Exclude licenses from search results
- Automate External Plugins table generation using **.automation/plugins.yml** file
- Add `--stats` argument to `build.sh` to update docker pull stats only when requested (manually, or from CI job Auto-Update-Linters), by @echoix in [#2677](https://github.com/oxsecurity/megalinter/pull/2677)
+ - Manage deprecation in JSON Schema variables
- Linter versions upgrades
- [cfn-lint](https://github.com/aws-cloudformation/cfn-lint) from 0.76.1 to **0.76.2** on 2023-04-04
diff --git a/README.md b/README.md
index 85e09839097..50785d69d8a 100644
--- a/README.md
+++ b/README.md
@@ -145,7 +145,6 @@ _Github PR reporter_
- [Plugins management](#plugins-management)
- [Simplify architecture and evolutive maintenance](#simplify-architecture-and-evolutive-maintenance)
- [Improve robustness \& stability](#improve-robustness--stability)
- - [V4 versus V5](#v4-versus-v5)
## Why MegaLinter
@@ -162,9 +161,9 @@ By using **MegaLinter**, you'll enjoy the following benefits for you and your te
- Reading error logs, **developers learn best practices** of the language they're using
- [**MegaLinter documentation**](https://megalinter.io/) provides the **list of IDE plugins integrating each linter**, so developers know which linter and plugins to install
- MegaLinter is **ready out of the box** after a [**quick setup**](#quick-start)
-- **Formatting and fixes** can be automatically [**applied on the git branch**](#apply-fixes) or [**provided in reports**](https://github.com/oxsecurity/megalinter/tree/main/docs/reporters/UpdatedSourcesReporter.md)
+- **Formatting and fixes** can be automatically [**applied on the git branch**](https://github.com/oxsecurity/megalinter/tree/main/docs/config-apply-fixes.md) or [**provided in reports**](https://github.com/oxsecurity/megalinter/tree/main/docs/reporters/UpdatedSourcesReporter.md)
- This tool is **100% open-source** and **free for all uses** (personal, professional, public and private repositories)
-- MegaLinter can run on [**any CI tool**](#installation) and be [**run locally**](https://megalinter.io/mega-linter-runner/): **no need to authorize an external application**, and **your code base never leaves your tooling ecosystem**
+- MegaLinter can run on [**any CI tool**](https://github.com/oxsecurity/megalinter/tree/main/docs/install-assisted.md) and be [**run locally**](https://megalinter.io/mega-linter-runner/): **no need to authorize an external application**, and **your code base never leaves your tooling ecosystem**
@@ -347,17 +346,28 @@ description: How to install MegaLinter on Github Actions, Gitlab CI, Azure Pipel
-->
## Installation
+
+
### Assisted installation
Just run `npx mega-linter-runner --install` at the root of your repository and answer questions, it will generate ready to use configuration files for MegaLinter :)
![Runner Install](https://github.com/oxsecurity/megalinter/blob/main/docs/assets/images/mega-linter-runner-generator.gif?raw=true)
-### Upgrade to MegaLinter v6
-
-- Run `npx mega-linter-runner --upgrade` to automatically upgrade your configuration from v4 or v5 to v6 :)
-
-### Manual installation
+
+
+
+### Which version to use ?
The following instructions examples are using latest MegaLinter stable version (**v6** , always corresponding to the [latest release](https://github.com/oxsecurity/megalinter/releases))
@@ -369,6 +379,14 @@ You can also use **beta** version (corresponding to the content of main branch)
- Docker image: `oxsecurity/megalinter:beta`
- GitHub Action: `oxsecurity/megalinter@beta`
+
+
+
### GitHub Action
1. Create a new file in your repository called `.github/workflows/mega-linter.yml`
@@ -485,6 +503,14 @@ jobs:
+
+
+
### GitLab CI
Create or update `.gitlab-ci.yml` file at the root of your repository
@@ -517,6 +543,14 @@ Create a Gitlab access token and define it in a variable **GITLAB_ACCESS_TOKEN_M
![Screenshot](https://github.com/oxsecurity/megalinter/blob/main/docs/assets/images/TextReporter_gitlab_1.jpg?raw=true>)
+
+
+
### Azure Pipelines
Use the following Azure Pipelines [YAML template](https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema)
@@ -556,6 +590,14 @@ Add the following job in your `azure-pipelines.yaml` file
To benefit from Pull Request comments, please follow [configuration instructions](https://github.com/oxsecurity/megalinter/tree/main/docs/reporters/AzureCommentReporter.md)
+
+
+
### Bitbucket Pipelines
1. Create a `bitbucket-pipelines.yml` file on the root directory of your repository
@@ -576,7 +618,14 @@ pipelines:
- megalinter-reports/**
```
-
+
+
+
### Jenkins
Add the following stage in your Jenkinsfile
@@ -604,6 +653,14 @@ stage('MegaLinter') {
}
```
+
+
+
### Concourse
#### Pipeline step
@@ -704,6 +761,14 @@ resources:
# VALIDATE_ALL_CODEBASE: true
```
+
+
+
### Drone CI
**Warning: Drone CI support is experimental and is undergoing heavy modifications (see issue [#2047](https://github.com/oxsecurity/megalinter/issues/2047)).**
@@ -756,6 +821,14 @@ trigger:
The workflow above should only trigger on push, not on any other situation. For more information about how to configure Drone CI trigger rules, [click here](https://docs.drone.io/pipeline/triggers/).
+
+
+
### Docker container
You can also run megalinter with its Docker container, just execute this command:
@@ -769,13 +842,21 @@ _Example:_
`docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:rw -v $(pwd):/example/folder:rw oxsecurity/megalinter:v6`
+
+
+
### Run MegaLinter locally
[![Version](https://img.shields.io/npm/v/mega-linter-runner.svg)](https://npmjs.org/package/mega-linter-runner)
[![Downloads/week](https://img.shields.io/npm/dw/mega-linter-runner.svg)](https://npmjs.org/package/mega-linter-runner)
[![Downloads/total](https://img.shields.io/npm/dt/mega-linter-runner.svg)](https://npmjs.org/package/mega-linter-runner)
-You can use [mega-linter-runner](https://megalinter.io/mega-linter-runner/) to locally run MegaLinter with the same configuration defined in [.mega-linter.yml](#configuration) file
+You can use [mega-linter-runner](https://megalinter.io/mega-linter-runner/) to locally run MegaLinter with the same configuration defined in [.mega-linter.yml](https://github.com/oxsecurity/megalinter/tree/main/docs/config-file.md) file
See [mega-linter-runner installation instructions](https://megalinter.io/mega-linter-runner/#installation)
@@ -787,6 +868,7 @@ npx mega-linter-runner --flavor salesforce -e "'ENABLE=DOCKERFILE,MARKDOWN,YAML'
Note: You can also use such command line in your custom CI/CD pipelines
+
@@ -798,6 +880,15 @@ description: List of all configuration variables that can be used to customize t
-->
## Configuration
+
+
+### .mega-linter.yml file
+
MegaLinter configuration variables are defined in a **.mega-linter.yml** file at the root of the repository or with **environment variables**.
You can see an example config file in this repo: [**.mega-linter.yml**](https://github.com/oxsecurity/megalinter/blob/main/.mega-linter.yml)
@@ -806,57 +897,76 @@ Configuration is assisted with autocompletion and validation in most commonly us
- VSCode: You need a VSCode extension like [Red Hat YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml)
- IDEA family: Auto-completion natively supported
+You can also define variables as environment variables.
+- In case a variable exists in both ENV and `.mega-linter.yml` file, priority is given to ENV variable.
+
![Assisted configuration](https://github.com/oxsecurity/megalinter/raw/main/docs/assets/images/assisted-configuration.gif)
+
+
+
### Common variables
-| **ENV VAR** | **Default Value** | **Notes** |
-|----------------------------------------------------------------------|-----------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| **ADDITIONAL_EXCLUDED_DIRECTORIES** | \[\] | List of additional excluded directory basenames. they're excluded at any nested level. |
-| [**APPLY_FIXES**](#apply-fixes) | `none` | Activates formatting and autofix [(more info)](#apply-fixes) |
-| **CLEAR_REPORT_FOLDER** | `false` | Flag to clear files from report folder (usually megalinter-reports) before starting the linting process |
-| **DEFAULT_BRANCH** | `HEAD` | Deprecated: The name of the repository's default branch. |
-| **DEFAULT_WORKSPACE** | `/tmp/lint` | The location containing files to lint if you are running locally. |
-| **DISABLE_ERRORS** | `false` | Flag to have the linter complete with exit code 0 even if errors were detected. |
-| [**DISABLE**](#activation-and-deactivation) | | List of disabled descriptors keys [(more info)](#activation-and-deactivation) |
-| [**DISABLE_LINTERS**](#activation-and-deactivation) | | List of disabled linters keys [(more info)](#activation-and-deactivation) |
-| [**DISABLE_ERRORS_LINTERS**](#activation-and-deactivation) | | List of enabled but not blocking linters keys [(more info)](#activation-and-deactivation) |
-| [**ENABLE**](#activation-and-deactivation) | | List of enabled descriptors keys [(more info)](#activation-and-deactivation) |
-| [**ENABLE_LINTERS**](#activation-and-deactivation) | | List of enabled linters keys [(more info)](#activation-and-deactivation) |
-| **EXCLUDED_DIRECTORIES** | \[…many values…\] | List of excluded directory basenames. they're excluded at any nested level. |
-| **EXTENDS** | | Base `mega-linter.yml` config file(s) to extend local configuration from. Can be a single URL or a list of `.mega-linter.yml` config files URLs. Later files take precedence. |
-| **FAIL_IF_MISSING_LINTER_IN_FLAVOR** | `false` | If set to `true`, MegaLinter fails if a linter is missing in the selected flavor |
-| **FAIL_IF_UPDATED_SOURCES** | `false` | If set to `true`, MegaLinter fails if a linter or formatter has autofixed sources, even if there are no errors |
-| [**FILTER_REGEX_EXCLUDE**](#filter-linted-files) | `none` | Regular expression defining which files will be excluded from linting [(more info)](#filter-linted-files) .ex: `.*src/test.*`) |
-| [**FILTER_REGEX_INCLUDE**](#filter-linted-files) | `all` | Regular expression defining which files will be processed by linters [(more info)](#filter-linted-files) .ex: `.*src/.*`) |
-| **FLAVOR_SUGGESTIONS** | `true` | Provides suggestions about different MegaLinter flavors to use to improve runtime performances |
-| **FORMATTERS_DISABLE_ERRORS** | `true` | Formatter errors will be reported as errors (and not warnings) if this variable is set to `false` |
-| **GIT_AUTHORIZATION_BEARER** | | If set, calls git with **`Authorization: Bearer`+value** |
-| **GITHUB_WORKSPACE** | | Base directory for `REPORT_OUTPUT_FOLDER`, for user-defined linter rules location, for location of linted files if `DEFAULT_WORKSPACE` isn't set |
-| **IGNORE_GENERATED_FILES** | `false` | If set to `true`, MegaLinter will skip files containing `@generated` marker but without `@not-generated` marker (more info at [https://generated.at](https://generated.at/)) |
-| **IGNORE_GITIGNORED_FILES** | `true` | If set to `true`, MegaLinter will skip files ignored by git using `.gitignore` file |
-| **JAVASCRIPT_DEFAULT_STYLE** | `standard` | Javascript default style to check/apply. `standard`,`prettier` |
-| **LINTER_RULES_PATH** | `.github/linters` | Directory for all linter configuration rules.
Can be a local folder or a remote URL (ex: `https://raw.githubusercontent.com/some_org/some_repo/mega-linter-rules` ) |
-| **LOG_FILE** | `mega-linter.log` | The file name for outputting logs. All output is sent to the log file regardless of `LOG_LEVEL`. Use `none` to not generate this file. |
-| **LOG_LEVEL** | `INFO` | How much output the script will generate to the console. One of `INFO`, `DEBUG`, `WARNING` or `ERROR`. |
-| **MARKDOWN_DEFAULT_STYLE** | `markdownlint` | Markdown default style to check/apply. `markdownlint`,`remark-lint` |
-| **MEGALINTER_CONFIG** | `.mega-linter.yml` | Name of MegaLinter configuration file. Can be defined remotely, in that case set this environment variable with the remote URL of `.mega-linter.yml` config file |
-| **MEGALINTER_FILES_TO_LINT** | \[\] | Comma-separated list of files to analyze. Using this variable will bypass other file listing methods |
-| **PARALLEL** | `true` | Process linters in parallel to improve overall MegaLinter performance. If true, linters of same language or formats are grouped in the same parallel process to avoid lock issues if fixing the same files |
-| [**PLUGINS**](#plugins) | \[\] | List of plugin urls to install and run during MegaLinter run |
-| [**POST_COMMANDS**](#post-commands) | \[\] | Custom bash commands to run after linters |
-| [**PRE_COMMANDS**](#pre-commands) | \[\] | Custom bash commands to run before linters |
-| **PRINT_ALPACA** | `true` | Enable printing alpaca image to console |
-| **PRINT_ALL_FILES** | `false` | Display all files analyzed by the linter instead of only the number |
-| **REPORT_OUTPUT_FOLDER** | `${GITHUB_WORKSPACE}/megalinter-reports` | Directory for generating report files. Set to `none` to not generate reports |
-| [**SECURED_ENV_VARIABLES**](#environment-variables-security) | \[\] | Additional list of secured environment variables to hide when calling linters. |
-| [**SECURED_ENV_VARIABLES_DEFAULT**](#environment-variables-security) | MegaLinter & CI platforms sensitive variables | List of secured environment variables to hide when calling linters. [Default list](#environment-variables-security). This is not recommended to override this variable, use SECURED_ENV_VARIABLES |
-| **SHOW_ELAPSED_TIME** | `false` | Displays elapsed time in reports |
-| **SHOW_SKIPPED_LINTERS** | `true` | Displays all disabled linters mega-linter could have run |
-| **SKIP_CLI_LINT_MODES** | \[\] | Comma-separated list of cli_lint_modes. To use if you want to skip linters with some CLI lint modes (ex: `file,project`). Available values: `file`,`cli_lint_mode`,`project`. |
-| **TYPESCRIPT_DEFAULT_STYLE** | `standard` | Typescript default style to check/apply. `standard`,`prettier` |
-| **VALIDATE_ALL_CODEBASE** | `true` | Will parse the entire repository and find all files to validate across all types. **NOTE:** When set to `false`, only **new** or **edited** files will be parsed for validation. |
-
+| **ENV VAR** | **Default Value** | **Notes** |
+|---------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **ADDITIONAL_EXCLUDED_DIRECTORIES** | \[\] | List of additional excluded directory basenames. they're excluded at any nested level. |
+| [**APPLY_FIXES**](https://github.com/oxsecurity/megalinter/tree/main/docs/config-apply-fixes.md) | `none` | Activates formatting and autofix [(more info)](https://github.com/oxsecurity/megalinter/tree/main/docs/config-apply-fixes.md) |
+| **CLEAR_REPORT_FOLDER** | `false` | Flag to clear files from report folder (usually megalinter-reports) before starting the linting process |
+| **DEFAULT_BRANCH** | `HEAD` | Deprecated: The name of the repository's default branch. |
+| **DEFAULT_WORKSPACE** | `/tmp/lint` | The location containing files to lint if you are running locally. |
+| **DISABLE_ERRORS** | `false` | Flag to have the linter complete with exit code 0 even if errors were detected. |
+| [**DISABLE**](https://github.com/oxsecurity/megalinter/tree/main/docs/config-activation.md) | | List of disabled descriptors keys [(more info)](https://github.com/oxsecurity/megalinter/tree/main/docs/config-activation.md) |
+| [**DISABLE_LINTERS**](https://github.com/oxsecurity/megalinter/tree/main/docs/config-activation.md) | | List of disabled linters keys [(more info)](https://github.com/oxsecurity/megalinter/tree/main/docs/config-activation.md) |
+| [**DISABLE_ERRORS_LINTERS**](https://github.com/oxsecurity/megalinter/tree/main/docs/config-activation.md) | | List of enabled but not blocking linters keys [(more info)](https://github.com/oxsecurity/megalinter/tree/main/docs/config-activation.md) |
+| [**ENABLE**](https://github.com/oxsecurity/megalinter/tree/main/docs/config-activation.md) | | List of enabled descriptors keys [(more info)](https://github.com/oxsecurity/megalinter/tree/main/docs/config-activation.md) |
+| [**ENABLE_LINTERS**](https://github.com/oxsecurity/megalinter/tree/main/docs/config-activation.md) | | List of enabled linters keys [(more info)](https://github.com/oxsecurity/megalinter/tree/main/docs/config-activation.md) |
+| **EXCLUDED_DIRECTORIES** | \[…many values…\] | List of excluded directory basenames. they're excluded at any nested level. |
+| **EXTENDS** | | Base `mega-linter.yml` config file(s) to extend local configuration from. Can be a single URL or a list of `.mega-linter.yml` config files URLs. Later files take precedence. |
+| **FAIL_IF_MISSING_LINTER_IN_FLAVOR** | `false` | If set to `true`, MegaLinter fails if a linter is missing in the selected flavor |
+| **FAIL_IF_UPDATED_SOURCES** | `false` | If set to `true`, MegaLinter fails if a linter or formatter has autofixed sources, even if there are no errors |
+| [**FILTER_REGEX_EXCLUDE**](https://github.com/oxsecurity/megalinter/tree/main/docs/config-filtering.md) | `none` | Regular expression defining which files will be excluded from linting [(more info)](https://github.com/oxsecurity/megalinter/tree/main/docs/config-filtering.md) .ex: `.*src/test.*`) |
+| [**FILTER_REGEX_INCLUDE**](https://github.com/oxsecurity/megalinter/tree/main/docs/config-filtering.md) | `all` | Regular expression defining which files will be processed by linters [(more info)](https://github.com/oxsecurity/megalinter/tree/main/docs/config-filtering.md) .ex: `.*src/.*`) |
+| **FLAVOR_SUGGESTIONS** | `true` | Provides suggestions about different MegaLinter flavors to use to improve runtime performances |
+| **FORMATTERS_DISABLE_ERRORS** | `true` | Formatter errors will be reported as errors (and not warnings) if this variable is set to `false` |
+| **GIT_AUTHORIZATION_BEARER** | | If set, calls git with **`Authorization: Bearer`+value** |
+| **GITHUB_WORKSPACE** | | Base directory for `REPORT_OUTPUT_FOLDER`, for user-defined linter rules location, for location of linted files if `DEFAULT_WORKSPACE` isn't set |
+| **IGNORE_GENERATED_FILES** | `false` | If set to `true`, MegaLinter will skip files containing `@generated` marker but without `@not-generated` marker (more info at [https://generated.at](https://generated.at/)) |
+| **IGNORE_GITIGNORED_FILES** | `true` | If set to `true`, MegaLinter will skip files ignored by git using `.gitignore` file |
+| **JAVASCRIPT_DEFAULT_STYLE** | `standard` | Javascript default style to check/apply. `standard`,`prettier` |
+| **LINTER_RULES_PATH** | `.github/linters` | Directory for all linter configuration rules.
Can be a local folder or a remote URL (ex: `https://raw.githubusercontent.com/some_org/some_repo/mega-linter-rules` ) |
+| **LOG_FILE** | `mega-linter.log` | The file name for outputting logs. All output is sent to the log file regardless of `LOG_LEVEL`. Use `none` to not generate this file. |
+| **LOG_LEVEL** | `INFO` | How much output the script will generate to the console. One of `INFO`, `DEBUG`, `WARNING` or `ERROR`. |
+| **MARKDOWN_DEFAULT_STYLE** | `markdownlint` | Markdown default style to check/apply. `markdownlint`,`remark-lint` |
+| **MEGALINTER_CONFIG** | `.mega-linter.yml` | Name of MegaLinter configuration file. Can be defined remotely, in that case set this environment variable with the remote URL of `.mega-linter.yml` config file |
+| **MEGALINTER_FILES_TO_LINT** | \[\] | Comma-separated list of files to analyze. Using this variable will bypass other file listing methods |
+| **PARALLEL** | `true` | Process linters in parallel to improve overall MegaLinter performance. If true, linters of same language or formats are grouped in the same parallel process to avoid lock issues if fixing the same files |
+| [**PLUGINS**](#plugins) | \[\] | List of plugin urls to install and run during MegaLinter run |
+| [**POST_COMMANDS**](https://github.com/oxsecurity/megalinter/tree/main/docs/config-postcommands.md) | \[\] | Custom bash commands to run after linters |
+| [**PRE_COMMANDS**](https://github.com/oxsecurity/megalinter/tree/main/docs/config-precommands.md) | \[\] | Custom bash commands to run before linters |
+| **PRINT_ALPACA** | `true` | Enable printing alpaca image to console |
+| **PRINT_ALL_FILES** | `false` | Display all files analyzed by the linter instead of only the number |
+| **REPORT_OUTPUT_FOLDER** | `${GITHUB_WORKSPACE}/megalinter-reports` | Directory for generating report files. Set to `none` to not generate reports |
+| [**SECURED_ENV_VARIABLES**](https://github.com/oxsecurity/megalinter/tree/main/docs/config-variables-security.md) | \[\] | Additional list of secured environment variables to hide when calling linters. |
+| [**SECURED_ENV_VARIABLES_DEFAULT**](https://github.com/oxsecurity/megalinter/tree/main/docs/config-variables-security.md) | MegaLinter & CI platforms sensitive variables | List of secured environment variables to hide when calling linters. [Default list](https://github.com/oxsecurity/megalinter/tree/main/docs/config-variables-security.md). This is not recommended to override this variable, use SECURED_ENV_VARIABLES |
+| **SHOW_ELAPSED_TIME** | `false` | Displays elapsed time in reports |
+| **SHOW_SKIPPED_LINTERS** | `true` | Displays all disabled linters mega-linter could have run |
+| **SKIP_CLI_LINT_MODES** | \[\] | Comma-separated list of cli_lint_modes. To use if you want to skip linters with some CLI lint modes (ex: `file,project`). Available values: `file`,`cli_lint_mode`,`project`. |
+| **TYPESCRIPT_DEFAULT_STYLE** | `standard` | Typescript default style to check/apply. `standard`,`prettier` |
+| **VALIDATE_ALL_CODEBASE** | `true` | Will parse the entire repository and find all files to validate across all types. **NOTE:** When set to `false`, only **new** or **edited** files will be parsed for validation. |
+
+
+
+
### Activation and deactivation
MegaLinter have all linters enabled by default, but allows to enable only some, or disable only some
@@ -891,6 +1001,14 @@ DISABLE_LINTERS:
- PHP_PSALM
```
+
+
+
### Filter linted files
If you need to lint only a folder or exclude some files from linting, you can use optional environment parameters `FILTER_REGEX_INCLUDE` and `FILTER_REGEX_EXCLUDE`
@@ -902,8 +1020,16 @@ Examples:
- Don't lint files inside test and example folders: `FILTER_REGEX_EXCLUDE: (test/|examples/)`
- Don't lint javascript files inside test folder: `FILTER_REGEX_EXCLUDE: (test/.*\.js)`
-Warning: not applicable with linters using CLI lint mode `project` ([see details](#cli-lint-mode))
+Warning: not applicable with linters using CLI lint mode `project` ([see details](https://github.com/oxsecurity/megalinter/tree/main/docs/config-cli-lint-mode.md))
+
+
+
### Apply fixes
Mega-linter is able to apply fixes provided by linters. To use this capability, you need 3 **env variables** defined at top level
@@ -940,10 +1066,26 @@ To solve these issues, you can apply one of the following solutions.
megalinter-reports/
```
+
+
+
### Linter specific variables
See variables related to a single linter behavior in [linters documentations](#supported-linters)
+
+
+
### Pre-commands
MegaLinter can run custom commands before running linters (for example, installing an plugin required by one of the linters you use)
@@ -960,6 +1102,14 @@ PRE_COMMANDS:
venv: flake8 # Will be run within flake8 python virtualenv. There is one virtualenv per python-based linter, with the same name
```
+
+
+
### Post-commands
MegaLinter can run custom commands after running linters (for example, running additional tests)
@@ -972,6 +1122,14 @@ POST_COMMANDS:
cwd: "workspace" # Will be run at the root of the workspace (usually your repository root)
```
+
+
+
### Environment variables security
MegaLinter runs on a docker image and calls the linters via command line to gather their results.
@@ -1020,8 +1178,16 @@ SECURED_ENV_VARIABLES=MY_SECRET_TOKEN,ANOTHER_VAR_CONTAINING_SENSITIVE_DATA,OX_A
Notes:
- If you override SECURED_ENV_VARIABLES_DEFAULT, it replaces the default list, so it's better to only define SECURED_ENV_VARIABLES to add them to the default list !
-- Environment variables are secured for each command line called (linters, plugins, sarif formatter...) except for [PRE_COMMANDS](#pre-commands) , as you might need secured values within their code.
+- Environment variables are secured for each command line called (linters, plugins, sarif formatter...) except for [PRE_COMMANDS](https://github.com/oxsecurity/megalinter/tree/main/docs/config-precommands.md) , as you might need secured values within their code.
+
+
+
### CLI lint mode
Each linter has a lint mode by default, visible in its MegaLinter documentation ([example](https://megalinter.io/latest/descriptors/repository_trivy/#how-the-linting-is-performed)):
@@ -1041,6 +1207,7 @@ Special considerations:
- As list of files isn't sent to the linter command, linters using `project` lint mode don't take in account some variables like FILTER_REGEX_INCLUDE and FILTER_REGEX_EXCLUDE. For those linters, you must check their documentation to define ignore configuration as it's awaited by the linter (for example with a `.secretlintignore` file for secretlint)
+
@@ -1422,6 +1589,12 @@ description: Detailed differences between MegaLinter and SuperLinter (performanc
The hard-fork of Super-Linter to be rewritten in Python isn't just a language switch: use of python flexibility and libraries allowed to define lots of additional functions described below
+### Security
+
+MegaLinter [hides many environment variables](https://github.com/oxsecurity/megalinter/tree/main/docs/config-variables-security.md) when calling the linters.
+
+That way you need to trust only MegaLinter core code with your secrets, not the 100+ embedded linters !
+
### Performances
- [MegaLinter Flavors](#flavors) allow to use **smaller docker images**, so the pull time is reduced
@@ -1434,7 +1607,7 @@ The hard-fork of Super-Linter to be rewritten in Python isn't just a language sw
### Automatically apply formatting and fixes
-MegaLinter can [**automatically apply fixes performed by linters**](#apply-fixes), and **push them to the same branch**, or **create a Pull Request** that you can validate
+MegaLinter can [**automatically apply fixes performed by linters**](https://github.com/oxsecurity/megalinter/tree/main/docs/config-apply-fixes.md), and **push them to the same branch**, or **create a Pull Request** that you can validate
This is pretty handy, especially for linter errors related to formatting (in that case, you don't have any manual update to perform)
@@ -1556,24 +1729,3 @@ For linters less commonly used, MegaLinters offers a plugins architecture so any
- Validate descriptor YML files with json schema during build
- Automated job to upgrade linters to their latest stable version
-
-## V4 versus V5
-
-- Tool to upgrade user repos configuration files using `npx mega-linter-runner --upgrade` (will upgrade references to _nvuillam/mega-linter_ into _oxsecurity/megalinter_)
-
-- Migration from github individual repo **nvuillam/mega-linter** to github organization repo **oxsecurity/megalinter**
-
-- Migration from docker hub space **nvuillam** to space **megalinter**
- - Docker images are now **oxsecurity/megalinter** or **oxsecurity/megalinter-FLAVOR**
-
-- Documentation is now hosted at
-
-- Version management: Now mega-linter docker images, github action and mega-linter-runner versions are aligned
- - **latest** for latest official release
- - **beta** for current content of main branch
- - **alpha** for current content of alpha branch
- - docker image, github action and mega-linter-runner can still be called with exact version number
-
-- Being more inclusive: rename `master` branch into `main`
-
-- **IGNORE_GITIGNORED_FILES** parameter default to `true`
diff --git a/docs/config-activation.md b/docs/config-activation.md
new file mode 100644
index 00000000000..40de947aee6
--- /dev/null
+++ b/docs/config-activation.md
@@ -0,0 +1,44 @@
+---
+title: Configure activation and deactivation of linters within MegaLinter
+description: You can enable, disable, make not blocking, allow a minimum number of errors...
+---
+
+
+
+
+# Activation and deactivation
+
+MegaLinter have all linters enabled by default, but allows to enable only some, or disable only some
+
+- If `ENABLE` isn't set, all descriptors are activated by default. If set, all linters of listed descriptors will be activated by default
+- If `ENABLE_LINTERS` is set, only listed linters will be processed
+- If `DISABLE` is set, the linters in the listed descriptors will be skipped
+- If `DISABLE_LINTERS` is set, the listed linters will be skipped
+- If `DISABLE_ERRORS_LINTERS` is set, the listed linters will be run, but if errors are found, they will be considered as non blocking
+
+Examples:
+
+- Run all javascript and groovy linters except STANDARD javascript linter. DevSkim errors will be non-blocking
+
+```yaml
+ENABLE: JAVASCRIPT,GROOVY
+DISABLE_LINTERS: JAVASCRIPT_STANDARD
+DISABLE_ERRORS_LINTERS: REPOSITORY_DEVSKIM
+```
+
+- Run all linters except PHP linters (PHP_BUILTIN, PHP_PHPCS, PHP_PHPSTAN, PHP_PSALM)
+
+```yaml
+DISABLE: PHP
+```
+
+- Run all linters except PHP_PHPSTAN and PHP_PSALM linters
+
+```yaml
+DISABLE_LINTERS:
+ - PHP_PHPSTAN
+ - PHP_PSALM
+```
+
+
+
diff --git a/docs/config-apply-fixes.md b/docs/config-apply-fixes.md
new file mode 100644
index 00000000000..dbbb4cf0d66
--- /dev/null
+++ b/docs/config-apply-fixes.md
@@ -0,0 +1,46 @@
+---
+title: Configure auto-fixing of issues by MegaLinter
+description: Use MegaLinter to auto apply corrections on your repository files
+---
+
+
+
+
+# Apply fixes
+
+Mega-linter is able to apply fixes provided by linters. To use this capability, you need 3 **env variables** defined at top level
+
+- **APPLY_FIXES**: `all` to apply fixes of all linters, or a list of linter keys (ex: `JAVASCRIPT_ES`,`MARKDOWN_MARKDOWNLINT`)
+
+Only for GitHub Action Workflow file if you use it:
+
+- **APPLY_FIXES_EVENT**: `all`, `push`, `pull_request`, `none` _(use none in case of use of [Updated sources reporter](reporters/UpdatedSourcesReporter.md))_
+- **APPLY_FIXES_MODE**: `commit` to create a new commit and push it on the same branch, or `pull_request` to create a new PR targeting the branch.
+
+## Apply fixes issues
+
+You may see **github permission errors**, or workflows not run on the new commit.
+
+To solve these issues, you can apply one of the following solutions.
+
+- Method 1: The most secured
+ - [Create Fine Grained Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token), scoped only on your repository and then copy the PAT value
+ - [Define environment secret variable](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-an-environment) named **PAT** on your repository, and paste the PAT value
+ - Update your Github Actions Workflow to add the environment name
+
+- Method 2: Easier, but any contributor with write access can see your Personal Access Token
+ - [Create Classic Personal Access Token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token#creating-a-token), then copy the PAT value
+ - [Define secret variable](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository) named **PAT** on your repository, and paste the PAT value
+
+## Notes
+
+- You can use [**Updated sources reporter**](reporters/UpdatedSourcesReporter.md) if you don't want fixes to be automatically applied on git branch, but **download them in a zipped file** and manually **extract them in your project**
+- If used, **APPLY_FIXES_EVENT** and **APPLY_FIXES_MODE** can not be defined in `.mega-linter.yml`config file, they must be set as environment variables
+- If you use **APPLY_FIXES**, add the following line in your `.gitignore file`
+
+```shell
+megalinter-reports/
+```
+
+
+
diff --git a/docs/config-cli-lint-mode.md b/docs/config-cli-lint-mode.md
new file mode 100644
index 00000000000..c41238aa483
--- /dev/null
+++ b/docs/config-cli-lint-mode.md
@@ -0,0 +1,29 @@
+---
+title: Override the way linters are called by MegaLinter
+description: Cli lint mode can be list_of_files, project or files
+---
+
+
+
+
+# CLI lint mode
+
+Each linter has a lint mode by default, visible in its MegaLinter documentation ([example](https://megalinter.io/latest/descriptors/repository_trivy/#how-the-linting-is-performed)):
+
+- `list_of_files`: All files are sent in single call to the linter
+- `project`: The linter is called from the root of the project, without specifying any file name
+- `file`: The linter is called once by file (so the performances may not be very good)
+
+You can override the CLI_LINT_MODE by using configuration variable for each linter (see [linters documentation](https://megalinter.io/supported-linters/))
+
+- Linters with `file` default lint mode can not be overridden to `list_of_files`
+- Linters with `project` default lint mode can not be overridden to `list_of_files` or `file`
+
+Allowing `file` or `list_of_files` to be overridden to `project` is mostly for workarounds, for example with linters that have a problem to find their config file when the current folder isn't the repo root.
+
+Special considerations:
+
+- As list of files isn't sent to the linter command, linters using `project` lint mode don't take in account some variables like FILTER_REGEX_INCLUDE and FILTER_REGEX_EXCLUDE. For those linters, you must check their documentation to define ignore configuration as it's awaited by the linter (for example with a `.secretlintignore` file for secretlint)
+
+
+
diff --git a/docs/config-file.md b/docs/config-file.md
new file mode 100644
index 00000000000..748ec280706
--- /dev/null
+++ b/docs/config-file.md
@@ -0,0 +1,25 @@
+---
+title: MegaLinter configuration file
+description: Use config file with auto-completion to customize MegaLinter behaviour
+---
+
+
+
+
+# .mega-linter.yml file
+
+MegaLinter configuration variables are defined in a **.mega-linter.yml** file at the root of the repository or with **environment variables**.
+You can see an example config file in this repo: [**.mega-linter.yml**](https://github.com/oxsecurity/megalinter/blob/main/.mega-linter.yml)
+
+Configuration is assisted with autocompletion and validation in most commonly used IDEs, thanks to [JSON schema](https://megalinter.io/json-schemas/configuration.html) stored on [schemastore.org](https://www.schemastore.org/)
+
+- VSCode: You need a VSCode extension like [Red Hat YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml)
+- IDEA family: Auto-completion natively supported
+
+You can also define variables as environment variables.
+- In case a variable exists in both ENV and `.mega-linter.yml` file, priority is given to ENV variable.
+
+![Assisted configuration](https://github.com/oxsecurity/megalinter/raw/main/docs/assets/images/assisted-configuration.gif)
+
+
+
diff --git a/docs/config-filtering.md b/docs/config-filtering.md
new file mode 100644
index 00000000000..80d48a1df1b
--- /dev/null
+++ b/docs/config-filtering.md
@@ -0,0 +1,23 @@
+---
+title: Configure filtering of files analyzed by MegaLinter
+description: Exclude files from linting
+---
+
+
+
+
+# Filter linted files
+
+If you need to lint only a folder or exclude some files from linting, you can use optional environment parameters `FILTER_REGEX_INCLUDE` and `FILTER_REGEX_EXCLUDE`
+You can apply filters to a single linter by defining variable `_FILTER_REGEX_INCLUDE` and `_FILTER_REGEX_EXCLUDE`
+
+Examples:
+
+- Lint only src folder: `FILTER_REGEX_INCLUDE: (src/)`
+- Don't lint files inside test and example folders: `FILTER_REGEX_EXCLUDE: (test/|examples/)`
+- Don't lint javascript files inside test folder: `FILTER_REGEX_EXCLUDE: (test/.*\.js)`
+
+Warning: not applicable with linters using CLI lint mode `project` ([see details](config-cli-lint-mode.md))
+
+
+
diff --git a/docs/config-linters.md b/docs/config-linters.md
new file mode 100644
index 00000000000..8066c31b9b2
--- /dev/null
+++ b/docs/config-linters.md
@@ -0,0 +1,14 @@
+---
+title: Linter scoped variables
+description: Every linters has its own variables that can be customized
+---
+
+
+
+
+# Linter specific variables
+
+See variables related to a single linter behavior in [linters documentations](supported-linters.md)
+
+
+
diff --git a/docs/config-postcommands.md b/docs/config-postcommands.md
new file mode 100644
index 00000000000..524b15fcfd0
--- /dev/null
+++ b/docs/config-postcommands.md
@@ -0,0 +1,22 @@
+---
+title: Configure custom commands to run after linters
+description: Customize your MegaLinter run by running commands after linters are run
+---
+
+
+
+
+# Post-commands
+
+MegaLinter can run custom commands after running linters (for example, running additional tests)
+
+Example in `.mega-linter.yml` config file
+
+```yaml
+POST_COMMANDS:
+ - command: npm run test
+ cwd: "workspace" # Will be run at the root of the workspace (usually your repository root)
+```
+
+
+
diff --git a/docs/config-precommands.md b/docs/config-precommands.md
new file mode 100644
index 00000000000..e7f861c46e5
--- /dev/null
+++ b/docs/config-precommands.md
@@ -0,0 +1,26 @@
+---
+title: Configure custom commands to run before linters
+description: Customize your MegaLinter run by installing linters extensions with npm, pip, or even raw bash before linters are run
+---
+
+
+
+
+# Pre-commands
+
+MegaLinter can run custom commands before running linters (for example, installing an plugin required by one of the linters you use)
+
+Example in `.mega-linter.yml` config file
+
+```yaml
+PRE_COMMANDS:
+ - command: npm install eslint-plugin-whatever
+ cwd: "root" # Will be run at the root of MegaLinter docker image
+ - command: echo "pre-test command has been called"
+ cwd: "workspace" # Will be run at the root of the workspace (usually your repository root)
+ - command: pip install flake8-cognitive-complexity
+ venv: flake8 # Will be run within flake8 python virtualenv. There is one virtualenv per python-based linter, with the same name
+```
+
+
+
diff --git a/docs/config-variables-security.md b/docs/config-variables-security.md
new file mode 100644
index 00000000000..bc38aada938
--- /dev/null
+++ b/docs/config-variables-security.md
@@ -0,0 +1,60 @@
+---
+title: Configure environment variables security with MegaLinter
+description: Hide from linter executables the environment variables that can contain secrets
+---
+
+
+
+
+# Environment variables security
+
+MegaLinter runs on a docker image and calls the linters via command line to gather their results.
+
+If you run it from your **CI/CD pipelines**, the docker image may have **access to your environment variables, that can contain secrets** defined in CI/CD variables.
+
+As it can be complicated to **trust** the authors of all the open-source linters, **MegaLinter removes variables from the environment used to call linters**.
+
+Thanks to this feature, you only need to [**trust MegaLinter and its internal python dependencies**](https://github.com/oxsecurity/megalinter/blob/main/megalinter/setup.py), but there is **no need to trust all the linters that are used** !
+
+You can add secured variables to the default list using configuration property **SECURED_ENV_VARIABLES** in .mega-linter.yml or in an environment variable (priority is given to ENV variables above `.mega-linter.yml` property).
+
+SECURED_ENV_VARIABLES_DEFAULT contains:
+
+- GITHUB_TOKEN
+- PAT
+- SYSTEM_ACCESSTOKEN
+- GIT_AUTHORIZATION_BEARER
+- CI_JOB_TOKEN
+- GITLAB_ACCESS_TOKEN_MEGALINTER
+- GITLAB_CUSTOM_CERTIFICATE
+- WEBHOOK_REPORTER_BEARER_TOKEN
+- NPM_TOKEN
+- DOCKER_USERNAME
+- DOCKER_PASSWORD
+- CODECOV_TOKEN
+- GCR_USERNAME
+- GCR_PASSWORD
+- SMTP_PASSWORD
+
+Example of adding extra secured variables `.mega-linter.yml`:
+
+```yaml
+SECURED_ENV_VARIABLES:
+ - MY_SECRET_TOKEN
+ - ANOTHER_VAR_CONTAINING_SENSITIVE_DATA
+ - OX_API_KEY
+```
+
+Example of adding extra secured variables in CI variables, so they can not be overridden in .mega-linter.yml:
+
+```shell
+SECURED_ENV_VARIABLES=MY_SECRET_TOKEN,ANOTHER_VAR_CONTAINING_SENSITIVE_DATA,OX_API_KEY
+```
+
+Notes:
+
+- If you override SECURED_ENV_VARIABLES_DEFAULT, it replaces the default list, so it's better to only define SECURED_ENV_VARIABLES to add them to the default list !
+- Environment variables are secured for each command line called (linters, plugins, sarif formatter...) except for [PRE_COMMANDS](config-precommands.md) , as you might need secured values within their code.
+
+
+
diff --git a/docs/config-variables.md b/docs/config-variables.md
new file mode 100644
index 00000000000..ce676772754
--- /dev/null
+++ b/docs/config-variables.md
@@ -0,0 +1,59 @@
+---
+title: All Megalinter configuration common variables
+description: List of common variables that you can use to customize MegaLinter behaviour
+---
+
+
+
+
+# Common variables
+
+| **ENV VAR** | **Default Value** | **Notes** |
+|-------------------------------------------------------------------|-----------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **ADDITIONAL_EXCLUDED_DIRECTORIES** | \[\] | List of additional excluded directory basenames. they're excluded at any nested level. |
+| [**APPLY_FIXES**](config-apply-fixes.md) | `none` | Activates formatting and autofix [(more info)](config-apply-fixes.md) |
+| **CLEAR_REPORT_FOLDER** | `false` | Flag to clear files from report folder (usually megalinter-reports) before starting the linting process |
+| **DEFAULT_BRANCH** | `HEAD` | Deprecated: The name of the repository's default branch. |
+| **DEFAULT_WORKSPACE** | `/tmp/lint` | The location containing files to lint if you are running locally. |
+| **DISABLE_ERRORS** | `false` | Flag to have the linter complete with exit code 0 even if errors were detected. |
+| [**DISABLE**](config-activation.md) | | List of disabled descriptors keys [(more info)](config-activation.md) |
+| [**DISABLE_LINTERS**](config-activation.md) | | List of disabled linters keys [(more info)](config-activation.md) |
+| [**DISABLE_ERRORS_LINTERS**](config-activation.md) | | List of enabled but not blocking linters keys [(more info)](config-activation.md) |
+| [**ENABLE**](config-activation.md) | | List of enabled descriptors keys [(more info)](config-activation.md) |
+| [**ENABLE_LINTERS**](config-activation.md) | | List of enabled linters keys [(more info)](config-activation.md) |
+| **EXCLUDED_DIRECTORIES** | \[…many values…\] | List of excluded directory basenames. they're excluded at any nested level. |
+| **EXTENDS** | | Base `mega-linter.yml` config file(s) to extend local configuration from. Can be a single URL or a list of `.mega-linter.yml` config files URLs. Later files take precedence. |
+| **FAIL_IF_MISSING_LINTER_IN_FLAVOR** | `false` | If set to `true`, MegaLinter fails if a linter is missing in the selected flavor |
+| **FAIL_IF_UPDATED_SOURCES** | `false` | If set to `true`, MegaLinter fails if a linter or formatter has autofixed sources, even if there are no errors |
+| [**FILTER_REGEX_EXCLUDE**](config-filtering.md) | `none` | Regular expression defining which files will be excluded from linting [(more info)](config-filtering.md) .ex: `.*src/test.*`) |
+| [**FILTER_REGEX_INCLUDE**](config-filtering.md) | `all` | Regular expression defining which files will be processed by linters [(more info)](config-filtering.md) .ex: `.*src/.*`) |
+| **FLAVOR_SUGGESTIONS** | `true` | Provides suggestions about different MegaLinter flavors to use to improve runtime performances |
+| **FORMATTERS_DISABLE_ERRORS** | `true` | Formatter errors will be reported as errors (and not warnings) if this variable is set to `false` |
+| **GIT_AUTHORIZATION_BEARER** | | If set, calls git with **`Authorization: Bearer`+value** |
+| **GITHUB_WORKSPACE** | | Base directory for `REPORT_OUTPUT_FOLDER`, for user-defined linter rules location, for location of linted files if `DEFAULT_WORKSPACE` isn't set |
+| **IGNORE_GENERATED_FILES** | `false` | If set to `true`, MegaLinter will skip files containing `@generated` marker but without `@not-generated` marker (more info at [https://generated.at](https://generated.at/)) |
+| **IGNORE_GITIGNORED_FILES** | `true` | If set to `true`, MegaLinter will skip files ignored by git using `.gitignore` file |
+| **JAVASCRIPT_DEFAULT_STYLE** | `standard` | Javascript default style to check/apply. `standard`,`prettier` |
+| **LINTER_RULES_PATH** | `.github/linters` | Directory for all linter configuration rules.
Can be a local folder or a remote URL (ex: `https://raw.githubusercontent.com/some_org/some_repo/mega-linter-rules` ) |
+| **LOG_FILE** | `mega-linter.log` | The file name for outputting logs. All output is sent to the log file regardless of `LOG_LEVEL`. Use `none` to not generate this file. |
+| **LOG_LEVEL** | `INFO` | How much output the script will generate to the console. One of `INFO`, `DEBUG`, `WARNING` or `ERROR`. |
+| **MARKDOWN_DEFAULT_STYLE** | `markdownlint` | Markdown default style to check/apply. `markdownlint`,`remark-lint` |
+| **MEGALINTER_CONFIG** | `.mega-linter.yml` | Name of MegaLinter configuration file. Can be defined remotely, in that case set this environment variable with the remote URL of `.mega-linter.yml` config file |
+| **MEGALINTER_FILES_TO_LINT** | \[\] | Comma-separated list of files to analyze. Using this variable will bypass other file listing methods |
+| **PARALLEL** | `true` | Process linters in parallel to improve overall MegaLinter performance. If true, linters of same language or formats are grouped in the same parallel process to avoid lock issues if fixing the same files |
+| [**PLUGINS**](plugins.md) | \[\] | List of plugin urls to install and run during MegaLinter run |
+| [**POST_COMMANDS**](config-postcommands.md) | \[\] | Custom bash commands to run after linters |
+| [**PRE_COMMANDS**](config-precommands.md) | \[\] | Custom bash commands to run before linters |
+| **PRINT_ALPACA** | `true` | Enable printing alpaca image to console |
+| **PRINT_ALL_FILES** | `false` | Display all files analyzed by the linter instead of only the number |
+| **REPORT_OUTPUT_FOLDER** | `${GITHUB_WORKSPACE}/megalinter-reports` | Directory for generating report files. Set to `none` to not generate reports |
+| [**SECURED_ENV_VARIABLES**](config-variables-security.md) | \[\] | Additional list of secured environment variables to hide when calling linters. |
+| [**SECURED_ENV_VARIABLES_DEFAULT**](config-variables-security.md) | MegaLinter & CI platforms sensitive variables | List of secured environment variables to hide when calling linters. [Default list](config-variables-security.md). This is not recommended to override this variable, use SECURED_ENV_VARIABLES |
+| **SHOW_ELAPSED_TIME** | `false` | Displays elapsed time in reports |
+| **SHOW_SKIPPED_LINTERS** | `true` | Displays all disabled linters mega-linter could have run |
+| **SKIP_CLI_LINT_MODES** | \[\] | Comma-separated list of cli_lint_modes. To use if you want to skip linters with some CLI lint modes (ex: `file,project`). Available values: `file`,`cli_lint_mode`,`project`. |
+| **TYPESCRIPT_DEFAULT_STYLE** | `standard` | Typescript default style to check/apply. `standard`,`prettier` |
+| **VALIDATE_ALL_CODEBASE** | `true` | Will parse the entire repository and find all files to validate across all types. **NOTE:** When set to `false`, only **new** or **edited** files will be parsed for validation. |
+
+
+
diff --git a/docs/descriptors/powershell_powershell.md b/docs/descriptors/powershell_powershell.md
index 5aafef91272..0fe2de4a44c 100644
--- a/docs/descriptors/powershell_powershell.md
+++ b/docs/descriptors/powershell_powershell.md
@@ -38,7 +38,7 @@ description: How to use powershell (configure, ignore files, ignore errors, help
| POWERSHELL_POWERSHELL_RULES_PATH | Path where to find linter configuration file | Workspace folder, then MegaLinter default rules |
| POWERSHELL_POWERSHELL_DISABLE_ERRORS | Run linter but consider errors as warnings | `false` |
| POWERSHELL_POWERSHELL_DISABLE_ERRORS_IF_LESS_THAN | Maximum number of errors allowed | `0` |
-| POWERSHELL_POWERSHELL_CLI_EXECUTABLE | Override CLI executable | `['pwsh']` |
+| POWERSHELL_POWERSHELL_CLI_EXECUTABLE | Override CLI executable | `['powershell']` |
## IDE Integration
diff --git a/docs/descriptors/powershell_powershell_formatter.md b/docs/descriptors/powershell_powershell_formatter.md
index 67cecc13e8b..dbd36c2ddc8 100644
--- a/docs/descriptors/powershell_powershell_formatter.md
+++ b/docs/descriptors/powershell_powershell_formatter.md
@@ -39,7 +39,7 @@ description: How to use powershell_formatter (configure, ignore files, ignore er
| POWERSHELL_POWERSHELL_FORMATTER_RULES_PATH | Path where to find linter configuration file | Workspace folder, then MegaLinter default rules |
| POWERSHELL_POWERSHELL_FORMATTER_DISABLE_ERRORS | Run linter but consider errors as warnings | `true` |
| POWERSHELL_POWERSHELL_FORMATTER_DISABLE_ERRORS_IF_LESS_THAN | Maximum number of errors allowed | `0` |
-| POWERSHELL_POWERSHELL_FORMATTER_CLI_EXECUTABLE | Override CLI executable | `['pwsh']` |
+| POWERSHELL_POWERSHELL_FORMATTER_CLI_EXECUTABLE | Override CLI executable | `['powershell']` |
## IDE Integration
diff --git a/docs/index.md b/docs/index.md
index e6887d2ac02..9c1e2196f03 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -82,9 +82,9 @@ By using **MegaLinter**, you'll enjoy the following benefits for you and your te
- Reading error logs, **developers learn best practices** of the language they're using
- [**MegaLinter documentation**](https://megalinter.io/) provides the **list of IDE plugins integrating each linter**, so developers know which linter and plugins to install
- MegaLinter is **ready out of the box** after a [**quick setup**](quick-start.md)
-- **Formatting and fixes** can be automatically [**applied on the git branch**](configuration.md#apply-fixes) or [**provided in reports**](reporters/UpdatedSourcesReporter.md)
+- **Formatting and fixes** can be automatically [**applied on the git branch**](config-apply-fixes.md) or [**provided in reports**](reporters/UpdatedSourcesReporter.md)
- This tool is **100% open-source** and **free for all uses** (personal, professional, public and private repositories)
-- MegaLinter can run on [**any CI tool**](installation.md) and be [**run locally**](https://megalinter.io/mega-linter-runner/): **no need to authorize an external application**, and **your code base never leaves your tooling ecosystem**
+- MegaLinter can run on [**any CI tool**](install-assisted.md) and be [**run locally**](https://megalinter.io/mega-linter-runner/): **no need to authorize an external application**, and **your code base never leaves your tooling ecosystem**
@@ -286,24 +286,3 @@ All linters are integrated in the [MegaLinter docker image](https://hub.docker.c
-
-## V4 versus V5
-
-- Tool to upgrade user repos configuration files using `npx mega-linter-runner --upgrade` (will upgrade references to _nvuillam/mega-linter_ into _oxsecurity/megalinter_)
-
-- Migration from github individual repo **nvuillam/mega-linter** to github organization repo **oxsecurity/megalinter**
-
-- Migration from docker hub space **nvuillam** to space **megalinter**
- - Docker images are now **oxsecurity/megalinter** or **oxsecurity/megalinter-FLAVOR**
-
-- Documentation is now hosted at
-
-- Version management: Now mega-linter docker images, github action and mega-linter-runner versions are aligned
- - **latest** for latest official release
- - **beta** for current content of main branch
- - **alpha** for current content of alpha branch
- - docker image, github action and mega-linter-runner can still be called with exact version number
-
-- Being more inclusive: rename `master` branch into `main`
-
-- **IGNORE_GITIGNORED_FILES** parameter default to `true`
diff --git a/docs/install-assisted.md b/docs/install-assisted.md
new file mode 100644
index 00000000000..95290f4caf0
--- /dev/null
+++ b/docs/install-assisted.md
@@ -0,0 +1,16 @@
+---
+title: Install mega-linter with automated setup
+description: Setup MegaLinter in 5 minutes thanks to its assisted installation tool
+---
+
+
+
+
+# Assisted installation
+
+Just run `npx mega-linter-runner --install` at the root of your repository and answer questions, it will generate ready to use configuration files for MegaLinter :)
+
+![Runner Install](https://github.com/oxsecurity/megalinter/blob/main/docs/assets/images/mega-linter-runner-generator.gif?raw=true)
+
+
+
diff --git a/docs/install-azure.md b/docs/install-azure.md
new file mode 100644
index 00000000000..98d69ffadc9
--- /dev/null
+++ b/docs/install-azure.md
@@ -0,0 +1,49 @@
+---
+title: Install MegaLinter on Azure Pipelines
+description: Manual instructions to setup MegaLinter as an Azure Pipelines job
+---
+
+
+
+
+# Azure Pipelines
+
+Use the following Azure Pipelines [YAML template](https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema)
+
+Add the following job in your `azure-pipelines.yaml` file
+
+```yaml
+ # Run MegaLinter to detect linting and security issues
+ - job: MegaLinter
+ pool:
+ vmImage: ubuntu-latest
+ steps:
+ # Checkout repo
+ - checkout: self
+
+ # Pull MegaLinter docker image
+ - script: docker pull oxsecurity/megalinter:v6
+ displayName: Pull MegaLinter
+
+ # Run MegaLinter
+ - script: |
+ docker run -v $(System.DefaultWorkingDirectory):/tmp/lint \
+ --env-file <(env | grep -e SYSTEM_ -e BUILD_ -e TF_ -e AGENT_) \
+ -e SYSTEM_ACCESSTOKEN=$(System.AccessToken) \
+ -e GIT_AUTHORIZATION_BEARER=$(System.AccessToken) \
+ oxsecurity/megalinter:v6
+ displayName: Run MegaLinter
+
+ # Upload MegaLinter reports
+ - task: PublishPipelineArtifact@1
+ condition: succeededOrFailed()
+ displayName: Upload MegaLinter reports
+ inputs:
+ targetPath: "$(System.DefaultWorkingDirectory)/megalinter-reports/"
+ artifactName: MegaLinterReport
+```
+
+To benefit from Pull Request comments, please follow [configuration instructions](reporters/AzureCommentReporter.md)
+
+
+
diff --git a/docs/install-bitbucket.md b/docs/install-bitbucket.md
new file mode 100644
index 00000000000..10b9c608b9c
--- /dev/null
+++ b/docs/install-bitbucket.md
@@ -0,0 +1,30 @@
+---
+title: Install MegaLinter on Bitbucket Pipelines
+description: Manual instructions to setup MegaLinter as a Bitbucket Pipelines job
+---
+
+
+
+
+# Bitbucket Pipelines
+
+1. Create a `bitbucket-pipelines.yml` file on the root directory of your repository
+
+2. Copy and paste the following template or add the step to your existing pipeline.
+
+```yaml
+image: atlassian/default-image:3
+pipelines:
+ default:
+ - parallel:
+ - step:
+ name: Run MegaLinter
+ image: oxsecurity/megalinter:v6
+ script:
+ - export DEFAULT_WORKSPACE=$BITBUCKET_CLONE_DIR && bash /entrypoint.sh
+ artifacts:
+ - megalinter-reports/**
+```
+
+
+
diff --git a/docs/install-concourse.md b/docs/install-concourse.md
new file mode 100644
index 00000000000..237a5dae4f6
--- /dev/null
+++ b/docs/install-concourse.md
@@ -0,0 +1,110 @@
+---
+title: Install MegaLinter on Concourse
+description: Manual instructions to setup MegaLinter as a Concourse job
+---
+
+
+
+
+# Concourse
+
+## Pipeline step
+
+Use the following `job.step` in your pipeline template
+
+Note: make sure you have `job.plan.get` step which gets `repo` containing your repository as shown in example
+
+```yaml
+---
+
+ - name: linting
+ plan:
+ - get: repo
+ - task: linting
+ config:
+ platform: linux
+ image_resource:
+ type: docker-image
+ source:
+ repository: oxsecurity/megalinter
+ tag: v6
+ inputs:
+ - name: repo
+ run:
+ path: bash
+ args:
+ - -cxe
+ - |
+ cd repo
+ export DEFAULT_WORKSPACE=$(pwd)
+ bash -ex /entrypoint.sh
+ ## doing this because concourse doesn't work as other CI systems
+ # params:
+ # PARALLEL: true
+ # DISABLE: SPELL
+ # APPLY_FIXES: all
+ # DISABLE_ERRORS: true
+ # VALIDATE_ALL_CODEBASE: true
+```
+
+OR
+
+## Use it as reusable task
+
+Create reusable concourse task which can be used with multiple pipelines
+
+1. Create task file `task-linting.yaml`
+
+```yaml
+---
+platform: linux
+image_resource:
+ type: docker-image
+ source:
+ repository: oxsecurity/megalinter
+ tag: v6
+
+inputs:
+- name: repo
+
+## uncomment this if you want reports as task output
+# output:
+# - name: reports
+# path: repo/megalinter-reports
+
+run:
+ path: bash
+ args:
+ - -cxe
+ - |
+ cd repo
+ export DEFAULT_WORKSPACE=$(pwd)
+ bash -ex /entrypoint.sh
+```
+
+2. Use that `task-linting.yaml` task in pipeline
+
+Note:
+
+ 1. make sure `task-linting.yaml` is available in that `repo` input at root
+
+ 2. task `output` is **not** shown here
+
+```yaml
+resources:
+
+ - name: linting
+ plan:
+ - get: repo
+ - task: linting
+ file: repo/task-linting.yaml
+ # params:
+ # PARALLEL: true
+ # DISABLE: SPELL
+ # APPLY_FIXES: all
+ # DISABLE_ERRORS: true
+ # VALIDATE_ALL_CODEBASE: true
+```
+
+
+
diff --git a/docs/install-docker.md b/docs/install-docker.md
new file mode 100644
index 00000000000..d7a5c0bd17f
--- /dev/null
+++ b/docs/install-docker.md
@@ -0,0 +1,23 @@
+---
+title: Run MegaLinter as a Docker image
+description: Manual instructions to run MegaLinter as a docker image
+---
+
+
+
+
+# Docker container
+
+You can also run megalinter with its Docker container, just execute this command:
+
+`docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:rw -v $(pwd):/tmp/lint:rw oxsecurity/megalinter:v6`
+
+**No extra arguments are needed,** however, megalinter will lint all of the files inside the `/tmp/lint` folder, so it may be needed to configure your tool of choice to use the `/tmp/lint` folder as workspace.
+This can also be changed:
+
+_Example:_
+
+`docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:rw -v $(pwd):/example/folder:rw oxsecurity/megalinter:v6`
+
+
+
diff --git a/docs/install-drone.md b/docs/install-drone.md
new file mode 100644
index 00000000000..041b44be4c7
--- /dev/null
+++ b/docs/install-drone.md
@@ -0,0 +1,62 @@
+---
+title: Install MegaLinter on Drone CI
+description: Manual instructions to setup MegaLinter as a Drone CI job
+---
+
+
+
+
+# Drone CI
+
+**Warning: Drone CI support is experimental and is undergoing heavy modifications (see issue [#2047](https://github.com/oxsecurity/megalinter/issues/2047)).**
+
+1. Create a `.drone.yml` file on the root directory of your repository
+
+2. Copy and paste the following template:
+
+```yaml
+kind: pipeline
+type: docker
+name: MegaLinter
+
+workspace:
+ path: /tmp/lint
+
+steps:
+
+- name: megalinter
+ image: oxsecurity/megalinter:v6
+ environment:
+ DEFAULT_WORKSPACE: /tmp/lint
+```
+
+This uses the [Drone CI docker runner](https://docs.drone.io/pipeline/docker/overview/), so it's needed to install and configure it beforehand on your Drone CI server.
+
+## (Optional) Adjusting trigger rules
+
+The Drone CI workflow should trigger automatically for every scenario (push, pull request, sync…) however, you can _optionally_ change this behavior by changing the trigger. For example:
+
+```yaml
+kind: pipeline
+type: docker
+name: MegaLinter
+
+workspace:
+ path: /tmp/lint
+
+steps:
+
+- name: megalinter
+ image: oxsecurity/megalinter:v6
+ environment:
+ DEFAULT_WORKSPACE: /tmp/lint
+
+trigger:
+ event:
+ - push
+```
+
+The workflow above should only trigger on push, not on any other situation. For more information about how to configure Drone CI trigger rules, [click here](https://docs.drone.io/pipeline/triggers/).
+
+
+
diff --git a/docs/install-github.md b/docs/install-github.md
new file mode 100644
index 00000000000..a9347a48e9a
--- /dev/null
+++ b/docs/install-github.md
@@ -0,0 +1,126 @@
+---
+title: Install MegaLinter on GitHub Actions
+description: Manual instructions to setup MegaLinter in a GitHub Action Workflow
+---
+
+
+
+
+# GitHub Action
+
+1. Create a new file in your repository called `.github/workflows/mega-linter.yml`
+2. Copy the [example workflow from below](https://raw.githubusercontent.com/oxsecurity/megalinter/main/TEMPLATES/mega-linter.yml) into that new file, no extra configuration required
+3. Commit that file to a new branch
+4. Open up a pull request and observe the action working
+5. Enjoy your more _stable_, and _cleaner_ code base
+
+**NOTES:**
+
+- If you pass the _Environment_ variable `GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}` in your workflow, then the **MegaLinter** will mark the status of each individual linter run in the Checks section of a pull request. Without this you will only see the overall status of the full run. There is no need to set the **GitHub** Secret as it's automatically set by GitHub, it only needs to be passed to the action.
+- You can also **use it outside of GitHub Actions** (CircleCI, Azure Pipelines, Jenkins, GitLab, or even locally with a docker run) , and have status on Github Pull Request if `GITHUB_TARGET_URL` environment variable exists.
+
+In your repository you should have a `.github/workflows` folder with **GitHub** Action similar to below:
+
+- `.github/workflows/mega-linter.yml`
+
+
+This file should have this code
+
+```yml
+---
+# MegaLinter GitHub Action configuration file
+# More info at https://megalinter.io
+name: MegaLinter
+
+on:
+ # Trigger mega-linter at every push. Action will also be visible from Pull Requests to main
+ push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions)
+ pull_request:
+ branches: [master, main]
+
+env: # Comment env block if you don't want to apply fixes
+ # Apply linter fixes configuration
+ APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool)
+ APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all)
+ APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request)
+
+concurrency:
+ group: ${{ github.ref }}-${{ github.workflow }}
+ cancel-in-progress: true
+
+jobs:
+ build:
+ name: MegaLinter
+ runs-on: ubuntu-latest
+ permissions:
+ # Give the default GITHUB_TOKEN write permission to commit and push, comment issues & post new PR
+ # Remove the ones you do not need
+ contents: write
+ issues: write
+ pull-requests: write
+ steps:
+ # Git Checkout
+ - name: Checkout Code
+ uses: actions/checkout@v3
+ with:
+ token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
+ fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances
+
+ # MegaLinter
+ - name: MegaLinter
+ id: ml
+ # You can override MegaLinter flavor used to have faster performances
+ # More info at https://megalinter.io/flavors/
+ uses: oxsecurity/megalinter@v6
+ env:
+ # All available variables are described in documentation
+ # https://megalinter.io/configuration/
+ VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Validates all source when push on main, else just the git diff with main. Override with true if you always want to lint all sources
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ # ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
+ # DISABLE: COPYPASTE,SPELL # Uncomment to disable copy-paste and spell checks
+
+ # Upload MegaLinter artifacts
+ - name: Archive production artifacts
+ if: ${{ success() }} || ${{ failure() }}
+ uses: actions/upload-artifact@v3
+ with:
+ name: MegaLinter reports
+ path: |
+ megalinter-reports
+ mega-linter.log
+
+ # Create pull request if applicable (for now works only on PR from same repository, not from forks)
+ - name: Create Pull Request with applied fixes
+ id: cpr
+ if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
+ uses: peter-evans/create-pull-request@v5
+ with:
+ token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
+ commit-message: "[MegaLinter] Apply linters automatic fixes"
+ title: "[MegaLinter] Apply linters automatic fixes"
+ labels: bot
+ - name: Create PR output
+ if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
+ run: |
+ echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
+ echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
+
+ # Push new commit if applicable (for now works only on PR from same repository, not from forks)
+ - name: Prepare commit
+ if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
+ run: sudo chown -Rc $UID .git/
+ - name: Commit and push applied linter fixes
+ if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
+ uses: stefanzweifel/git-auto-commit-action@v4
+ with:
+ branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
+ commit_message: "[MegaLinter] Apply linters fixes"
+ commit_user_name: megalinter-bot
+ commit_user_email: nicolas.vuillamy@ox.security
+```
+
+
+
+
+
diff --git a/docs/install-gitlab.md b/docs/install-gitlab.md
new file mode 100644
index 00000000000..d70e15c7887
--- /dev/null
+++ b/docs/install-gitlab.md
@@ -0,0 +1,42 @@
+---
+title: Install MegaLinter on Gitlab CI
+description: Manual instructions to setup MegaLinter as a Gitlab Pipeline job
+---
+
+
+
+
+# GitLab CI
+
+Create or update `.gitlab-ci.yml` file at the root of your repository
+
+```yaml
+# MegaLinter GitLab CI job configuration file
+# More info at https://megalinter.io/
+
+mega-linter:
+ stage: test
+ # You can override MegaLinter flavor used to have faster performances
+ # More info at https://megalinter.io/flavors/
+ image: oxsecurity/megalinter:v6
+ script: [ "true" ] # if script: ["true"] doesn't work, you may try -> script: [ "/bin/bash /entrypoint.sh" ]
+ variables:
+ # All available variables are described in documentation
+ # https://megalinter.io/configuration/
+ DEFAULT_WORKSPACE: $CI_PROJECT_DIR
+ # ADD YOUR CUSTOM ENV VARIABLES HERE TO OVERRIDE VALUES OF .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
+ artifacts:
+ when: always
+ paths:
+ - megalinter-reports
+ expire_in: 1 week
+```
+
+Create a Gitlab access token and define it in a variable **GITLAB_ACCESS_TOKEN_MEGALINTER** in the project CI/CD masked variables. Make sure your token (e.g. if a project token) as the appropriate [role](https://docs.gitlab.com/ee/user/permissions.html) for commenting a merge request (at least developer).
+
+![config-gitlab-access-token](https://user-images.githubusercontent.com/17500430/151674446-1bcb1420-d9aa-4ae1-aaae-dcf51afb36ab.gif)
+
+![Screenshot](https://github.com/oxsecurity/megalinter/blob/main/docs/assets/images/TextReporter_gitlab_1.jpg?raw=true>)
+
+
+
diff --git a/docs/install-jenkins.md b/docs/install-jenkins.md
new file mode 100644
index 00000000000..648432cdcc7
--- /dev/null
+++ b/docs/install-jenkins.md
@@ -0,0 +1,37 @@
+---
+title: Install MegaLinter on Jenkins
+description: Manual instructions to setup MegaLinter as a Jenkins job
+---
+
+
+
+
+# Jenkins
+
+Add the following stage in your Jenkinsfile
+
+You may activate [File.io reporter](https://megalinter.io/reporters/FileIoReporter/) or [E-mail reporter](https://megalinter.io/reporters/EmailReporter/) to access detailed logs and fixed source
+
+```groovy
+// Lint with MegaLinter: https://megalinter.io/
+stage('MegaLinter') {
+ agent {
+ docker {
+ image 'oxsecurity/megalinter:v6'
+ args "-u root -e VALIDATE_ALL_CODEBASE=true -v ${WORKSPACE}:/tmp/lint --entrypoint=''"
+ reuseNode true
+ }
+ }
+ steps {
+ sh '/entrypoint.sh'
+ }
+ post {
+ always {
+ archiveArtifacts allowEmptyArchive: true, artifacts: 'mega-linter.log,megalinter-reports/**/*', defaultExcludes: false, followSymlinks: false
+ }
+ }
+}
+```
+
+
+
diff --git a/docs/install-locally.md b/docs/install-locally.md
new file mode 100644
index 00000000000..f715f40c5a2
--- /dev/null
+++ b/docs/install-locally.md
@@ -0,0 +1,28 @@
+---
+title: Run MegaLinter locally on your computer
+description: Manual instructions to run MegaLinter locally on your computer
+---
+
+
+
+
+# Run MegaLinter locally
+
+[![Version](https://img.shields.io/npm/v/mega-linter-runner.svg)](https://npmjs.org/package/mega-linter-runner)
+[![Downloads/week](https://img.shields.io/npm/dw/mega-linter-runner.svg)](https://npmjs.org/package/mega-linter-runner)
+[![Downloads/total](https://img.shields.io/npm/dt/mega-linter-runner.svg)](https://npmjs.org/package/mega-linter-runner)
+
+You can use [mega-linter-runner](https://megalinter.io/mega-linter-runner/) to locally run MegaLinter with the same configuration defined in [.mega-linter.yml](config-file.md) file
+
+See [mega-linter-runner installation instructions](https://megalinter.io/mega-linter-runner/#installation)
+
+Example
+
+```shell
+npx mega-linter-runner --flavor salesforce -e "'ENABLE=DOCKERFILE,MARKDOWN,YAML'" -e 'SHOW_ELAPSED_TIME=true'
+```
+
+Note: You can also use such command line in your custom CI/CD pipelines
+
+
+
diff --git a/docs/install-version.md b/docs/install-version.md
new file mode 100644
index 00000000000..1d46f0efa68
--- /dev/null
+++ b/docs/install-version.md
@@ -0,0 +1,22 @@
+---
+title: Selecting a MegaLinter version to use
+description: You can use latest release or beta version of MegaLinter, know the differences !
+---
+
+
+
+
+# Which version to use ?
+
+The following instructions examples are using latest MegaLinter stable version (**v6** , always corresponding to the [latest release](https://github.com/oxsecurity/megalinter/releases))
+
+- Docker image: `oxsecurity/megalinter:v6`
+- GitHub Action: `oxsecurity/megalinter@v6`
+
+You can also use **beta** version (corresponding to the content of main branch)
+
+- Docker image: `oxsecurity/megalinter:beta`
+- GitHub Action: `oxsecurity/megalinter@beta`
+
+
+
diff --git a/docs/mega-linter-vs-super-linter.md b/docs/mega-linter-vs-super-linter.md
index a96fcb32b0c..5cc9fd343fa 100644
--- a/docs/mega-linter-vs-super-linter.md
+++ b/docs/mega-linter-vs-super-linter.md
@@ -10,6 +10,12 @@ description: Detailed differences between MegaLinter and SuperLinter (performanc
The hard-fork of Super-Linter to be rewritten in Python isn't just a language switch: use of python flexibility and libraries allowed to define lots of additional functions described below
+## Security
+
+MegaLinter [hides many environment variables](config-variables-security.md) when calling the linters.
+
+That way you need to trust only MegaLinter core code with your secrets, not the 100+ embedded linters !
+
## Performances
- [MegaLinter Flavors](flavors.md) allow to use **smaller docker images**, so the pull time is reduced
@@ -22,7 +28,7 @@ The hard-fork of Super-Linter to be rewritten in Python isn't just a language sw
## Automatically apply formatting and fixes
-MegaLinter can [**automatically apply fixes performed by linters**](configuration.md#apply-fixes), and **push them to the same branch**, or **create a Pull Request** that you can validate
+MegaLinter can [**automatically apply fixes performed by linters**](config-apply-fixes.md), and **push them to the same branch**, or **create a Pull Request** that you can validate
This is pretty handy, especially for linter errors related to formatting (in that case, you don't have any manual update to perform)
diff --git a/docs/quick-start.md b/docs/quick-start.md
index 34330feb9c2..18689838156 100644
--- a/docs/quick-start.md
+++ b/docs/quick-start.md
@@ -18,7 +18,7 @@ description: Setup MegaLinter in 5 minutes thanks to its assisted installation t
- This repo is a hard-fork of [GitHub Super-Linter](https://github.com/github/super-linter), rewritten in python to add [lots of additional features](mega-linter-vs-super-linter.md)
- If you are a Super-Linter user, you can transparently **switch to MegaLinter and keep the same configuration** (just replace `github/super-linter@v3` by `oxsecurity/megalinter@v6` in your GitHub Action YML file, [like on this PR](https://github.com/nvuillam/npm-groovy-lint/pull/109))
-- If you want to use MegaLinter extra features (recommended), please take 5 minutes to use [MegaLinter assisted installation](installation.md)
+- If you want to use MegaLinter extra features (recommended), please take 5 minutes to use [MegaLinter assisted installation](install-assisted.md)
- For a hand-holdy example of getting started with mega-linter check out [this blog post](https://ayyjohn.com/posts/linting-a-jekyll-blog-with-mega-linter) by Alec Johnson
diff --git a/megalinter/descriptors/schemas/megalinter-configuration.jsonschema.json b/megalinter/descriptors/schemas/megalinter-configuration.jsonschema.json
index 1b1fb33764d..6302227b166 100644
--- a/megalinter/descriptors/schemas/megalinter-configuration.jsonschema.json
+++ b/megalinter/descriptors/schemas/megalinter-configuration.jsonschema.json
@@ -2086,7 +2086,7 @@
"items": {
"type": "string"
},
- "title": "CREDENTIALS_SECRETLINT: Custom arguments",
+ "title": "(removed) CREDENTIALS_SECRETLINT: Custom arguments",
"type": [
"array",
"string"
@@ -2096,19 +2096,19 @@
"$id": "#/properties/CREDENTIALS_SECRETLINT_CONFIG_FILE",
"default": ".secretlintrc.json",
"description": "CREDENTIALS_SECRETLINT: User custom config file name if different from default",
- "title": "CREDENTIALS_SECRETLINT: Custom config file name",
+ "title": "(removed) CREDENTIALS_SECRETLINT: Custom config file name",
"type": "string"
},
"CREDENTIALS_SECRETLINT_DISABLE_ERRORS": {
"$id": "#/properties/CREDENTIALS_SECRETLINT_DISABLE_ERRORS",
"default": false,
- "title": "CREDENTIALS_SECRETLINT: Linter does not make MegaLinter fail even if errors are found",
+ "title": "(removed) CREDENTIALS_SECRETLINT: Linter does not make MegaLinter fail even if errors are found",
"type": "boolean"
},
"CREDENTIALS_SECRETLINT_DISABLE_ERRORS_IF_LESS_THAN": {
"$id": "#/properties/CREDENTIALS_SECRETLINT_DISABLE_ERRORS_IF_LESS_THAN",
"default": 0,
- "title": "CREDENTIALS_SECRETLINT: Maximum number of errors allowed",
+ "title": "(removed) CREDENTIALS_SECRETLINT: Maximum number of errors allowed",
"type": "number"
},
"CREDENTIALS_SECRETLINT_FILE_EXTENSIONS": {
@@ -2120,7 +2120,7 @@
"items": {
"type": "string"
},
- "title": "CREDENTIALS_SECRETLINT: Override descriptor/linter matching files extensions",
+ "title": "(removed) CREDENTIALS_SECRETLINT: Override descriptor/linter matching files extensions",
"type": "array"
},
"CREDENTIALS_SECRETLINT_FILE_NAMES_REGEX": {
@@ -2132,7 +2132,7 @@
"items": {
"type": "string"
},
- "title": "CREDENTIALS_SECRETLINT: Override descriptor/linter matching file name regex",
+ "title": "(removed) CREDENTIALS_SECRETLINT: Override descriptor/linter matching file name regex",
"type": "array"
},
"CREDENTIALS_SECRETLINT_POST_COMMANDS": {
@@ -2149,7 +2149,7 @@
"items": {
"$ref": "#/definitions/command_info"
},
- "title": "CREDENTIALS_SECRETLINT: Define or override a list of bash commands to run after the linter",
+ "title": "(removed) CREDENTIALS_SECRETLINT: Define or override a list of bash commands to run after the linter",
"type": "array"
},
"CREDENTIALS_SECRETLINT_PRE_COMMANDS": {
@@ -2166,13 +2166,13 @@
"items": {
"$ref": "#/definitions/command_info"
},
- "title": "CREDENTIALS_SECRETLINT: Define or override a list of bash commands to run before the linter",
+ "title": "(removed) CREDENTIALS_SECRETLINT: Define or override a list of bash commands to run before the linter",
"type": "array"
},
"CREDENTIALS_SECRETLINT_RULES_PATH": {
"$id": "#/properties/CREDENTIALS_SECRETLINT_RULES_PATH",
"description": "CREDENTIALS_SECRETLINT: Path where to find linter configuration file",
- "title": "CREDENTIALS_SECRETLINT: Custom config file path",
+ "title": "(removed) CREDENTIALS_SECRETLINT: Custom config file path",
"type": "string"
},
"CSHARP_CSHARPIER_ARGUMENTS": {
@@ -3072,7 +3072,7 @@
"items": {
"type": "string"
},
- "title": "DOCKERFILE_DOCKERFILELINT: Custom arguments",
+ "title": "(removed) DOCKERFILE_DOCKERFILELINT: Custom arguments",
"type": [
"array",
"string"
@@ -3086,26 +3086,26 @@
"list_of_files",
"project"
],
- "title": "DOCKERFILE_DOCKERFILELINT: Override default cli lint mode",
+ "title": "(removed) DOCKERFILE_DOCKERFILELINT: Override default cli lint mode",
"type": "string"
},
"DOCKERFILE_DOCKERFILELINT_CONFIG_FILE": {
"$id": "#/properties/DOCKERFILE_DOCKERFILELINT_CONFIG_FILE",
"default": ".dockerfilelintrc",
"description": "DOCKERFILE_DOCKERFILELINT: User custom config file name if different from default",
- "title": "DOCKERFILE_DOCKERFILELINT: Custom config file name",
+ "title": "(removed) DOCKERFILE_DOCKERFILELINT: Custom config file name",
"type": "string"
},
"DOCKERFILE_DOCKERFILELINT_DISABLE_ERRORS": {
"$id": "#/properties/DOCKERFILE_DOCKERFILELINT_DISABLE_ERRORS",
"default": false,
- "title": "DOCKERFILE_DOCKERFILELINT: Linter does not make MegaLinter fail even if errors are found",
+ "title": "(removed) DOCKERFILE_DOCKERFILELINT: Linter does not make MegaLinter fail even if errors are found",
"type": "boolean"
},
"DOCKERFILE_DOCKERFILELINT_DISABLE_ERRORS_IF_LESS_THAN": {
"$id": "#/properties/DOCKERFILE_DOCKERFILELINT_DISABLE_ERRORS_IF_LESS_THAN",
"default": 0,
- "title": "DOCKERFILE_DOCKERFILELINT: Maximum number of errors allowed",
+ "title": "(removed) DOCKERFILE_DOCKERFILELINT: Maximum number of errors allowed",
"type": "number"
},
"DOCKERFILE_DOCKERFILELINT_FILE_EXTENSIONS": {
@@ -3117,14 +3117,14 @@
"items": {
"type": "string"
},
- "title": "DOCKERFILE_DOCKERFILELINT: Override descriptor/linter matching files extensions",
+ "title": "(removed) DOCKERFILE_DOCKERFILELINT: Override descriptor/linter matching files extensions",
"type": "array"
},
"DOCKERFILE_DOCKERFILELINT_FILE_NAME": {
"$id": "#/properties/DOCKERFILE_DOCKERFILELINT_FILE_NAME",
"default": ".dockerfilelintrc",
"description": "DOCKERFILE_DOCKERFILELINT: User custom config file name if different from default",
- "title": "DOCKERFILE_DOCKERFILELINT: Custom config file name",
+ "title": "(removed) DOCKERFILE_DOCKERFILELINT: Custom config file name",
"type": "string"
},
"DOCKERFILE_DOCKERFILELINT_FILE_NAMES_REGEX": {
@@ -3136,17 +3136,17 @@
"items": {
"type": "string"
},
- "title": "DOCKERFILE_DOCKERFILELINT: Override descriptor/linter matching file name regex",
+ "title": "(removed) DOCKERFILE_DOCKERFILELINT: Override descriptor/linter matching file name regex",
"type": "array"
},
"DOCKERFILE_DOCKERFILELINT_FILTER_REGEX_EXCLUDE": {
"$id": "#/properties/DOCKERFILE_DOCKERFILELINT_FILTER_REGEX_EXCLUDE",
- "title": "DOCKERFILE_DOCKERFILELINT: Excluding Regex",
+ "title": "(removed) DOCKERFILE_DOCKERFILELINT: Excluding Regex",
"type": "string"
},
"DOCKERFILE_DOCKERFILELINT_FILTER_REGEX_INCLUDE": {
"$id": "#/properties/DOCKERFILE_DOCKERFILELINT_FILTER_REGEX_INCLUDE",
- "title": "DOCKERFILE_DOCKERFILELINT: Including Regex",
+ "title": "(removed) DOCKERFILE_DOCKERFILELINT: Including Regex",
"type": "string"
},
"DOCKERFILE_DOCKERFILELINT_POST_COMMANDS": {
@@ -3163,7 +3163,7 @@
"items": {
"$ref": "#/definitions/command_info"
},
- "title": "DOCKERFILE_DOCKERFILELINT: Define or override a list of bash commands to run after the linter",
+ "title": "(removed) DOCKERFILE_DOCKERFILELINT: Define or override a list of bash commands to run after the linter",
"type": "array"
},
"DOCKERFILE_DOCKERFILELINT_PRE_COMMANDS": {
@@ -3180,13 +3180,13 @@
"items": {
"$ref": "#/definitions/command_info"
},
- "title": "DOCKERFILE_DOCKERFILELINT: Define or override a list of bash commands to run before the linter",
+ "title": "(removed) DOCKERFILE_DOCKERFILELINT: Define or override a list of bash commands to run before the linter",
"type": "array"
},
"DOCKERFILE_DOCKERFILELINT_RULES_PATH": {
"$id": "#/properties/DOCKERFILE_DOCKERFILELINT_RULES_PATH",
"description": "DOCKERFILE_DOCKERFILELINT: Path where to find linter configuration file",
- "title": "DOCKERFILE_DOCKERFILELINT: Custom config file path",
+ "title": "(removed) DOCKERFILE_DOCKERFILELINT: Custom config file path",
"type": "string"
},
"DOCKERFILE_FILTER_REGEX_EXCLUDE": {
@@ -4044,7 +4044,7 @@
"items": {
"type": "string"
},
- "title": "GIT_GIT_DIFF: Custom arguments",
+ "title": "(removed) GIT_GIT_DIFF: Custom arguments",
"type": [
"array",
"string"
@@ -4053,13 +4053,13 @@
"GIT_GIT_DIFF_DISABLE_ERRORS": {
"$id": "#/properties/GIT_GIT_DIFF_DISABLE_ERRORS",
"default": false,
- "title": "GIT_GIT_DIFF: Linter does not make MegaLinter fail even if errors are found",
+ "title": "(removed) GIT_GIT_DIFF: Linter does not make MegaLinter fail even if errors are found",
"type": "boolean"
},
"GIT_GIT_DIFF_DISABLE_ERRORS_IF_LESS_THAN": {
"$id": "#/properties/GIT_GIT_DIFF_DISABLE_ERRORS_IF_LESS_THAN",
"default": 0,
- "title": "GIT_GIT_DIFF: Maximum number of errors allowed",
+ "title": "(removed) GIT_GIT_DIFF: Maximum number of errors allowed",
"type": "number"
},
"GIT_GIT_DIFF_FILE_EXTENSIONS": {
@@ -4071,7 +4071,7 @@
"items": {
"type": "string"
},
- "title": "GIT_GIT_DIFF: Override descriptor/linter matching files extensions",
+ "title": "(removed) GIT_GIT_DIFF: Override descriptor/linter matching files extensions",
"type": "array"
},
"GIT_GIT_DIFF_FILE_NAMES_REGEX": {
@@ -4083,7 +4083,7 @@
"items": {
"type": "string"
},
- "title": "GIT_GIT_DIFF: Override descriptor/linter matching file name regex",
+ "title": "(removed) GIT_GIT_DIFF: Override descriptor/linter matching file name regex",
"type": "array"
},
"GIT_GIT_DIFF_POST_COMMANDS": {
@@ -4100,7 +4100,7 @@
"items": {
"$ref": "#/definitions/command_info"
},
- "title": "GIT_GIT_DIFF: Define or override a list of bash commands to run after the linter",
+ "title": "(removed) GIT_GIT_DIFF: Define or override a list of bash commands to run after the linter",
"type": "array"
},
"GIT_GIT_DIFF_PRE_COMMANDS": {
@@ -4117,7 +4117,7 @@
"items": {
"$ref": "#/definitions/command_info"
},
- "title": "GIT_GIT_DIFF: Define or override a list of bash commands to run before the linter",
+ "title": "(removed) GIT_GIT_DIFF: Define or override a list of bash commands to run before the linter",
"type": "array"
},
"GO_FILTER_REGEX_EXCLUDE": {
@@ -6990,7 +6990,7 @@
"items": {
"type": "string"
},
- "title": "KUBERNETES_KUBEVAL: Custom arguments",
+ "title": "(removed) KUBERNETES_KUBEVAL: Custom arguments",
"type": [
"array",
"string"
@@ -7006,7 +7006,7 @@
"items": {
"type": "string"
},
- "title": "KUBERNETES_KUBEVAL: CLI Executable",
+ "title": "(removed) KUBERNETES_KUBEVAL: CLI Executable",
"type": "array"
},
"KUBERNETES_KUBEVAL_CLI_LINT_MODE": {
@@ -7016,25 +7016,25 @@
"file",
"project"
],
- "title": "KUBERNETES_KUBEVAL: Override default cli lint mode",
+ "title": "(removed) KUBERNETES_KUBEVAL: Override default cli lint mode",
"type": "string"
},
"KUBERNETES_KUBEVAL_DIRECTORY": {
"$id": "#/properties/KUBERNETES_KUBEVAL_DIRECTORY",
"default": "kubernetes",
- "title": "KUBERNETES_KUBEVAL: Directory containing KUBERNETES files",
+ "title": "(removed) KUBERNETES_KUBEVAL: Directory containing KUBERNETES files",
"type": "string"
},
"KUBERNETES_KUBEVAL_DISABLE_ERRORS": {
"$id": "#/properties/KUBERNETES_KUBEVAL_DISABLE_ERRORS",
"default": false,
- "title": "KUBERNETES_KUBEVAL: Linter doesn't make MegaLinter fail even if errors are found",
+ "title": "(removed) KUBERNETES_KUBEVAL: Linter doesn't make MegaLinter fail even if errors are found",
"type": "boolean"
},
"KUBERNETES_KUBEVAL_DISABLE_ERRORS_IF_LESS_THAN": {
"$id": "#/properties/KUBERNETES_KUBEVAL_DISABLE_ERRORS_IF_LESS_THAN",
"default": 0,
- "title": "KUBERNETES_KUBEVAL: Maximum number of errors allowed",
+ "title": "(removed) KUBERNETES_KUBEVAL: Maximum number of errors allowed",
"type": "number"
},
"KUBERNETES_KUBEVAL_FILE_EXTENSIONS": {
@@ -7046,7 +7046,7 @@
"items": {
"type": "string"
},
- "title": "KUBERNETES_KUBEVAL: Override descriptor/linter matching files extensions",
+ "title": "(removed) KUBERNETES_KUBEVAL: Override descriptor/linter matching files extensions",
"type": "array"
},
"KUBERNETES_KUBEVAL_FILE_NAMES_REGEX": {
@@ -7058,17 +7058,17 @@
"items": {
"type": "string"
},
- "title": "KUBERNETES_KUBEVAL: Override descriptor/linter matching file name regex",
+ "title": "(removed) KUBERNETES_KUBEVAL: Override descriptor/linter matching file name regex",
"type": "array"
},
"KUBERNETES_KUBEVAL_FILTER_REGEX_EXCLUDE": {
"$id": "#/properties/KUBERNETES_KUBEVAL_FILTER_REGEX_EXCLUDE",
- "title": "KUBERNETES_KUBEVAL: Excluding Regex",
+ "title": "(removed) KUBERNETES_KUBEVAL: Excluding Regex",
"type": "string"
},
"KUBERNETES_KUBEVAL_FILTER_REGEX_INCLUDE": {
"$id": "#/properties/KUBERNETES_KUBEVAL_FILTER_REGEX_INCLUDE",
- "title": "KUBERNETES_KUBEVAL: Including Regex",
+ "title": "(removed) KUBERNETES_KUBEVAL: Including Regex",
"type": "string"
},
"KUBERNETES_KUBEVAL_POST_COMMANDS": {
@@ -7085,7 +7085,7 @@
"items": {
"$ref": "#/definitions/command_info"
},
- "title": "KUBERNETES_KUBEVAL: Define or override a list of bash commands to run after the linter",
+ "title": "(removed) KUBERNETES_KUBEVAL: Define or override a list of bash commands to run after the linter",
"type": "array"
},
"KUBERNETES_KUBEVAL_PRE_COMMANDS": {
@@ -7102,7 +7102,7 @@
"items": {
"$ref": "#/definitions/command_info"
},
- "title": "KUBERNETES_KUBEVAL: Define or override a list of bash commands to run before the linter",
+ "title": "(removed) KUBERNETES_KUBEVAL: Define or override a list of bash commands to run before the linter",
"type": "array"
},
"LATEX_CHKTEX_ARGUMENTS": {
@@ -8518,7 +8518,7 @@
"items": {
"type": "string"
},
- "title": "PHP_BUILTIN: Custom arguments",
+ "title": "(removed) PHP_BUILTIN: Custom arguments",
"type": [
"array",
"string"
@@ -8526,7 +8526,7 @@
},
"PHP_BUILTIN_CLI_EXECUTABLE": {
"$id": "#/properties/PHP_BUILTIN_CLI_EXECUTABLE",
- "title": "PHP_BUILTIN: Override default CLI executable for linting request",
+ "title": "(removed) PHP_BUILTIN: Override default CLI executable for linting request",
"type": "string"
},
"PHP_BUILTIN_CLI_LINT_MODE": {
@@ -8537,19 +8537,19 @@
"list_of_files",
"project"
],
- "title": "PHP_BUILTIN: Override default cli lint mode",
+ "title": "(removed) PHP_BUILTIN: Override default cli lint mode",
"type": "string"
},
"PHP_BUILTIN_DISABLE_ERRORS": {
"$id": "#/properties/PHP_BUILTIN_DISABLE_ERRORS",
"default": false,
- "title": "PHP_BUILTIN: Linter does not make MegaLinter fail even if errors are found",
+ "title": "(removed) PHP_BUILTIN: Linter does not make MegaLinter fail even if errors are found",
"type": "boolean"
},
"PHP_BUILTIN_DISABLE_ERRORS_IF_LESS_THAN": {
"$id": "#/properties/PHP_BUILTIN_DISABLE_ERRORS_IF_LESS_THAN",
"default": 0,
- "title": "PHP_BUILTIN: Maximum number of errors allowed",
+ "title": "(removed) PHP_BUILTIN: Maximum number of errors allowed",
"type": "number"
},
"PHP_BUILTIN_FILE_EXTENSIONS": {
@@ -8561,7 +8561,7 @@
"items": {
"type": "string"
},
- "title": "PHP_BUILTIN: Override descriptor/linter matching files extensions",
+ "title": "(removed) PHP_BUILTIN: Override descriptor/linter matching files extensions",
"type": "array"
},
"PHP_BUILTIN_FILE_NAMES_REGEX": {
@@ -8573,17 +8573,17 @@
"items": {
"type": "string"
},
- "title": "PHP_BUILTIN: Override descriptor/linter matching file name regex",
+ "title": "(removed) PHP_BUILTIN: Override descriptor/linter matching file name regex",
"type": "array"
},
"PHP_BUILTIN_FILTER_REGEX_EXCLUDE": {
"$id": "#/properties/PHP_BUILTIN_FILTER_REGEX_EXCLUDE",
- "title": "PHP_BUILTIN: Excluding Regex",
+ "title": "(removed) PHP_BUILTIN: Excluding Regex",
"type": "string"
},
"PHP_BUILTIN_FILTER_REGEX_INCLUDE": {
"$id": "#/properties/PHP_BUILTIN_FILTER_REGEX_INCLUDE",
- "title": "PHP_BUILTIN: Including Regex",
+ "title": "(removed) PHP_BUILTIN: Including Regex",
"type": "string"
},
"PHP_BUILTIN_POST_COMMANDS": {
@@ -8600,7 +8600,7 @@
"items": {
"$ref": "#/definitions/command_info"
},
- "title": "PHP_BUILTIN: Define or override a list of bash commands to run after the linter",
+ "title": "(removed) PHP_BUILTIN: Define or override a list of bash commands to run after the linter",
"type": "array"
},
"PHP_BUILTIN_PRE_COMMANDS": {
@@ -8617,7 +8617,7 @@
"items": {
"$ref": "#/definitions/command_info"
},
- "title": "PHP_BUILTIN: Define or override a list of bash commands to run before the linter",
+ "title": "(removed) PHP_BUILTIN: Define or override a list of bash commands to run before the linter",
"type": "array"
},
"PHP_FILTER_REGEX_EXCLUDE": {
@@ -9267,7 +9267,7 @@
"$id": "#/properties/POWERSHELL_POWERSHELL_CLI_EXECUTABLE",
"default": [
[
- "pwsh"
+ "powershell"
]
],
"items": {
@@ -9366,7 +9366,7 @@
"$id": "#/properties/POWERSHELL_POWERSHELL_FORMATTER_CLI_EXECUTABLE",
"default": [
[
- "pwsh"
+ "powershell"
]
],
"items": {
@@ -11543,7 +11543,7 @@
"items": {
"type": "string"
},
- "title": "REPOSITORY_GOODCHECK: Custom arguments",
+ "title": "(removed) REPOSITORY_GOODCHECK: Custom arguments",
"type": [
"array",
"string"
@@ -11559,26 +11559,26 @@
"items": {
"type": "string"
},
- "title": "REPOSITORY_GOODCHECK: CLI Executable",
+ "title": "(removed) REPOSITORY_GOODCHECK: CLI Executable",
"type": "array"
},
"REPOSITORY_GOODCHECK_CONFIG_FILE": {
"$id": "#/properties/REPOSITORY_GOODCHECK_CONFIG_FILE",
"default": "goodcheck.yml",
"description": "REPOSITORY_GOODCHECK: User custom config file name if different from default",
- "title": "REPOSITORY_GOODCHECK: Custom config file name",
+ "title": "(removed) REPOSITORY_GOODCHECK: Custom config file name",
"type": "string"
},
"REPOSITORY_GOODCHECK_DISABLE_ERRORS": {
"$id": "#/properties/REPOSITORY_GOODCHECK_DISABLE_ERRORS",
"default": false,
- "title": "REPOSITORY_GOODCHECK: Linter doesn't make MegaLinter fail even if errors are found",
+ "title": "(removed) REPOSITORY_GOODCHECK: Linter doesn't make MegaLinter fail even if errors are found",
"type": "boolean"
},
"REPOSITORY_GOODCHECK_DISABLE_ERRORS_IF_LESS_THAN": {
"$id": "#/properties/REPOSITORY_GOODCHECK_DISABLE_ERRORS_IF_LESS_THAN",
"default": 0,
- "title": "REPOSITORY_GOODCHECK: Maximum number of errors allowed",
+ "title": "(removed) REPOSITORY_GOODCHECK: Maximum number of errors allowed",
"type": "number"
},
"REPOSITORY_GOODCHECK_POST_COMMANDS": {
@@ -11595,7 +11595,7 @@
"items": {
"$ref": "#/definitions/command_info"
},
- "title": "REPOSITORY_GOODCHECK: Define or override a list of bash commands to run after the linter",
+ "title": "(removed) REPOSITORY_GOODCHECK: Define or override a list of bash commands to run after the linter",
"type": "array"
},
"REPOSITORY_GOODCHECK_PRE_COMMANDS": {
@@ -11612,13 +11612,13 @@
"items": {
"$ref": "#/definitions/command_info"
},
- "title": "REPOSITORY_GOODCHECK: Define or override a list of bash commands to run before the linter",
+ "title": "(removed) REPOSITORY_GOODCHECK: Define or override a list of bash commands to run before the linter",
"type": "array"
},
"REPOSITORY_GOODCHECK_RULES_PATH": {
"$id": "#/properties/REPOSITORY_GOODCHECK_RULES_PATH",
"description": "REPOSITORY_GOODCHECK: Path where to find linter configuration file",
- "title": "REPOSITORY_GOODCHECK: Custom config file path",
+ "title": "(removed) REPOSITORY_GOODCHECK: Custom config file path",
"type": "string"
},
"REPOSITORY_SECRETLINT_ARGUMENTS": {
@@ -14902,7 +14902,7 @@
"items": {
"type": "string"
},
- "title": "TERRAFORM_CHECKOV: Custom arguments",
+ "title": "(removed) TERRAFORM_CHECKOV: Custom arguments",
"type": [
"array",
"string"
@@ -14918,7 +14918,7 @@
"items": {
"type": "string"
},
- "title": "TERRAFORM_CHECKOV: CLI Executable",
+ "title": "(removed) TERRAFORM_CHECKOV: CLI Executable",
"type": "array"
},
"TERRAFORM_CHECKOV_CLI_LINT_MODE": {
@@ -14928,19 +14928,19 @@
"file",
"project"
],
- "title": "TERRAFORM_CHECKOV: Override default cli lint mode",
+ "title": "(removed) TERRAFORM_CHECKOV: Override default cli lint mode",
"type": "string"
},
"TERRAFORM_CHECKOV_DISABLE_ERRORS": {
"$id": "#/properties/TERRAFORM_CHECKOV_DISABLE_ERRORS",
"default": false,
- "title": "TERRAFORM_CHECKOV: Linter doesn't make MegaLinter fail even if errors are found",
+ "title": "(removed) TERRAFORM_CHECKOV: Linter doesn't make MegaLinter fail even if errors are found",
"type": "boolean"
},
"TERRAFORM_CHECKOV_DISABLE_ERRORS_IF_LESS_THAN": {
"$id": "#/properties/TERRAFORM_CHECKOV_DISABLE_ERRORS_IF_LESS_THAN",
"default": 0,
- "title": "TERRAFORM_CHECKOV: Maximum number of errors allowed",
+ "title": "(removed) TERRAFORM_CHECKOV: Maximum number of errors allowed",
"type": "number"
},
"TERRAFORM_CHECKOV_FILE_EXTENSIONS": {
@@ -14952,7 +14952,7 @@
"items": {
"type": "string"
},
- "title": "TERRAFORM_CHECKOV: Override descriptor/linter matching files extensions",
+ "title": "(removed) TERRAFORM_CHECKOV: Override descriptor/linter matching files extensions",
"type": "array"
},
"TERRAFORM_CHECKOV_FILE_NAMES_REGEX": {
@@ -14964,17 +14964,17 @@
"items": {
"type": "string"
},
- "title": "TERRAFORM_CHECKOV: Override descriptor/linter matching file name regex",
+ "title": "(removed) TERRAFORM_CHECKOV: Override descriptor/linter matching file name regex",
"type": "array"
},
"TERRAFORM_CHECKOV_FILTER_REGEX_EXCLUDE": {
"$id": "#/properties/TERRAFORM_CHECKOV_FILTER_REGEX_EXCLUDE",
- "title": "TERRAFORM_CHECKOV: Excluding Regex",
+ "title": "(removed) TERRAFORM_CHECKOV: Excluding Regex",
"type": "string"
},
"TERRAFORM_CHECKOV_FILTER_REGEX_INCLUDE": {
"$id": "#/properties/TERRAFORM_CHECKOV_FILTER_REGEX_INCLUDE",
- "title": "TERRAFORM_CHECKOV: Including Regex",
+ "title": "(removed) TERRAFORM_CHECKOV: Including Regex",
"type": "string"
},
"TERRAFORM_CHECKOV_POST_COMMANDS": {
@@ -14991,7 +14991,7 @@
"items": {
"$ref": "#/definitions/command_info"
},
- "title": "TERRAFORM_CHECKOV: Define or override a list of bash commands to run after the linter",
+ "title": "(removed) TERRAFORM_CHECKOV: Define or override a list of bash commands to run after the linter",
"type": "array"
},
"TERRAFORM_CHECKOV_PRE_COMMANDS": {
@@ -15008,7 +15008,7 @@
"items": {
"$ref": "#/definitions/command_info"
},
- "title": "TERRAFORM_CHECKOV: Define or override a list of bash commands to run before the linter",
+ "title": "(removed) TERRAFORM_CHECKOV: Define or override a list of bash commands to run before the linter",
"type": "array"
},
"TERRAFORM_FILTER_REGEX_EXCLUDE": {
diff --git a/mkdocs.yml b/mkdocs.yml
index 7ddb499b408..8cc6d7c8710 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -60,8 +60,29 @@ extra:
nav:
- "Home": "index.md"
- "Quick Start": "quick-start.md"
- - "Installation": "installation.md"
- - "Configuration": "configuration.md"
+ - "Installation":
+ - "Assisted Installation": "install-assisted.md"
+ - "Which version to use ?": "install-version.md"
+ - "GitHub Actions": "install-github.md"
+ - "Gitlab CI": "install-gitlab.md"
+ - "Azure Pipelines": "install-azure.md"
+ - "Bitbucket Pipelines": "install-bitbucket.md"
+ - "Jenkins": "install-jenkins.md"
+ - "Concourse CI": "install-concourse.md"
+ - "Drone CI": "install-drone.md"
+ - "Docker (CLI)": "install-docker.md"
+ - "Run locally": "install-locally.md"
+ - "Configuration":
+ - ".mega-linter.yml file": "config-file.md"
+ - "Common Variables": "config-variables.md"
+ - "Activation / Deactivation": "config-activation.md"
+ - "Filtering files": "config-filtering.md"
+ - "Apply fixes": "config-apply-fixes.md"
+ - "Linter scopes variables": "config-linters.md"
+ - "Pre-commands": "config-precommands.md"
+ - "Post-commands": "config-postcommands.md"
+ - "ENV variables security": "config-variables-security.md"
+ - "CLI lint mode": "config-cli-lint-mode.md"
- "Linters":
- "All supported linters": "supported-linters.md"
- "Languages linters":