You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://github.com/oxsecurity/megalinter/blob/main/./docs/used-by-stats.md)<!-- gh-dependents-info-used-by-end -->
26
+
[](https://github.com/oxsecurity/megalinter/blob/main/./docs/used-by-stats.md)<!-- gh-dependents-info-used-by-end -->
27
27
[](https://github.com/aquasecurity/trivy)
MegaLinter is an **open-source** tool for **CI/CD workflows** that analyzes the **consistency of your code**, **IaC**, **configuration**, and **scripts** in your repository to **ensure all your project sources are clean and formatted**, regardless of the IDE or tools used by your developers. Powered by [**OX Security**](https://www.ox.security/?ref=megalinter).
35
+
MegaLinter is an **open-source** tool for **CI/CD workflows** that analyzes the **consistency of your code**, **IaC**, **configuration**, and **scripts** in your repository to **ensure all your project sources are clean and formatted**, no matter which IDE or toolbox is used by your developers. Powered by [**OX Security**](https://www.ox.security/?ref=megalinter).
36
36
37
-
Supporting[**65** languages](#languages), [**22** formats](#formats), and [**20** tooling formats](#tooling-formats). It is **ready to use out of the box** as a GitHub Action or with any CI system, **highly configurable**, and **free for all uses**.
37
+
Supports[**65** languages](#languages), [**22** formats](#formats), [**20** tooling formats](#tooling-formats), and is **ready to use out of the box** as a GitHub Action or with any CI system. It is **highly configurable** and **free for all uses**.
38
38
39
39
MegaLinter has **native integrations** with many major CI/CD tools.
Copy file name to clipboardExpand all lines: docs/config-apply-fixes.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,35 +8,35 @@ description: Use MegaLinter to auto apply corrections on your repository files
8
8
9
9
# Apply fixes
10
10
11
-
Mega-linter is able to apply fixes provided by linters. To use this capability, you need 3 **env variables** defined at top level
11
+
MegaLinter can apply fixes provided by linters. To use this capability, you need three environment variables defined at the top level.
12
12
13
13
-**APPLY_FIXES**: `all` to apply fixes of all linters, or a list of linter keys (ex: `JAVASCRIPT_ES`,`MARKDOWN_MARKDOWNLINT`)
14
14
15
-
Only for GitHub Action Workflow file if you use it:
15
+
Only for the GitHub Actions workflow file, if you use it:
16
16
17
17
-**APPLY_FIXES_EVENT**: `all`, `push`, `pull_request`, `none`_(use none in case of use of [Updated sources reporter](reporters/UpdatedSourcesReporter.md))_
18
18
-**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.
19
19
20
20
## Apply fixes issues
21
21
22
-
You may see **github permission errors**, or workflows not run on the new commit.
22
+
You may see GitHub permission errors, or workflows not running on the new commit.
23
23
24
-
To solve these issues, you can apply one of the following solutions.
24
+
To solve these issues, apply one of the following solutions.
25
25
26
26
- Method 1: The most secured
27
-
-[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 with **Contents: Read/Write** and then copy the PAT value
27
+
-[Create a 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 to your repository and with **Contents: Read/Write**, then copy the PAT value
28
28
-[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
29
-
- Update your Github Actions Workflow to add the environment name
29
+
- Update your GitHub Actions workflow to add the environment name
30
30
31
-
- Method 2: Easier, but any contributor with write access can see your Personal Access Token, so use it only on private repositories.
32
-
-[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
33
-
-[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
31
+
-- Method 2: Easier, but any contributor with write access can see your Personal Access Token, so use it only on private repositories.
32
+
-[Create a 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
33
+
-[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
34
34
35
35
## Notes
36
36
37
-
- 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**
38
-
- 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
39
-
- If you use **APPLY_FIXES**, add the following line in your `.gitignore file`
37
+
- You can use the [Updated sources reporter](reporters/UpdatedSourcesReporter.md) if you don't want fixes to be automatically applied on the Git branch. Instead, download them in a ZIP file and manually extract them into your project.
38
+
- If used, `APPLY_FIXES_EVENT` and `APPLY_FIXES_MODE` cannot be defined in the `.mega-linter.yml`config file; they must be set as environment variables.
39
+
- If you use `APPLY_FIXES`, add the following line to your `.gitignore` file:
Copy file name to clipboardExpand all lines: docs/config-cli-lint-mode.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,22 +8,22 @@ description: Cli lint mode can be list_of_files, project or files
8
8
9
9
# CLI lint mode
10
10
11
-
Each linter is pre-configured to use a default lint mode, which are visible in the MegaLinter documentation ([example](https://megalinter.io/latest/descriptors/repository_trivy/#how-the-linting-is-performed)). The possible values are:
11
+
Each linter is preconfigured to use a default lint mode, which is visible in the MegaLinter documentation ([example](https://megalinter.io/latest/descriptors/repository_trivy/#how-the-linting-is-performed)). The possible values are:
12
12
13
13
-`list_of_files`: The linter is called only once, and passed a list of all the files to be processed
14
-
-`project`: The linter is called only once, from the root folder of the repository, and it scans for the files to process, as no file names are provided it
14
+
-`project`: The linter is called only once, from the root folder of the repository, and it scans for the files to process, as no file names are provided to it
15
15
-`file`: The linter is called once per file, which hurts performance
16
16
17
-
You can override the CLI_LINT_MODE by using a configuration variable for each linter (see [linters documentation](https://megalinter.io/supported-linters/)).
17
+
You can override the CLI_LINT_MODE by using a configuration variable for each linter (see the [linters documentation](https://megalinter.io/supported-linters/)).
18
18
19
-
- Linters that default to the `file` lint mode cannot be overridden to use the `list_of_files` lint mode
19
+
- Linters that default to the `file` lint mode cannot be overridden to use the `list_of_files` lint mode.
20
20
- Linters that default to the `project` lint mode cannot be overridden to use either the `list_of_files` or `file` lint modes.
21
21
22
-
Allowing `file` or `list_of_files` to be overridden to `project` is mostly for workarounds. For example, some linters have a problem finding their config file when the current folder isn't the repository's root folder.
22
+
Allowing `file` or `list_of_files` to be overridden to `project` is mostly for workarounds. For example, some linters have a problem finding their config file when the current folder isn't the repository root.
23
23
24
24
Special considerations:
25
25
26
-
- Linters that are configured to use the `project` lint mode ignore variables like `FILTER_REGEX_INCLUDE` and `FILTER_REGEX_EXCLUDE`, as they are not passed a list of files to lint. For those linters, you must check their documentation to see if a linter can be configured to ignore specific files. For example, the [Secretlint](https://megalinter.io/latest/descriptors/repository_secretlint/) linter ignore files listed in `~/.secretlintignore` by default, or it can be configured to instead ignore files listed in `~/.gitignore` by setting `REPOSITORY_SECRETLINT_ARGUMENTS` to `--secretlintignore .gitignore.`.
26
+
- Linters that are configured to use the `project` lint mode ignore variables like `FILTER_REGEX_INCLUDE` and `FILTER_REGEX_EXCLUDE`, as they are not passed a list of files to lint. For those linters, you must check their documentation to see if a linter can be configured to ignore specific files. For example, the [Secretlint](https://megalinter.io/latest/descriptors/repository_secretlint/) linter ignores files listed in `~/.secretlintignore` by default, or it can be configured to instead ignore files listed in `~/.gitignore` by setting `REPOSITORY_SECRETLINT_ARGUMENTS` to `--secretlintignore .gitignore.`
Copy file name to clipboardExpand all lines: docs/config-file.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,15 +9,15 @@ description: Use config file with auto-completion to customize MegaLinter behavi
9
9
# .mega-linter.yml file
10
10
11
11
MegaLinter configuration variables are defined in a **.mega-linter.yml** file at the root of the repository or with **environment variables**.
12
-
You can see an example config file in this repo: [**.mega-linter.yml**](https://github.com/oxsecurity/megalinter/blob/main/.mega-linter.yml)
12
+
You can see an example config file in this repo: [**.mega-linter.yml**](https://github.com/oxsecurity/megalinter/blob/main/.mega-linter.yml).
13
13
14
-
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/)
14
+
Configuration is assisted with autocompletion and validation in most commonly used IDEs, thanks to the [JSON schema](https://megalinter.io/json-schemas/configuration.html) stored on [schemastore.org](https://www.schemastore.org/).
15
15
16
-
-VSCode: You need a VSCode extension like [Red Hat YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml)
17
-
- IDEA family: Auto-completion natively supported
16
+
-VS Code: You need an extension like [Red Hat YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml).
17
+
-IntelliJ IDEA family: Autocompletion is supported natively.
18
18
19
19
You can also define variables as environment variables.
20
-
-In case a variable exists in both ENV and `.mega-linter.yml` file, priority is given to ENV variable.
20
+
-If a variable exists in both ENV and the `.mega-linter.yml` file, priority is given to the ENV variable.
Copy file name to clipboardExpand all lines: docs/config-filtering.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,16 +8,16 @@ description: Exclude files from linting
8
8
9
9
# Filter linted files
10
10
11
-
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`
12
-
You can apply filters to a single linter by defining variable `<LINTER_KEY>_FILTER_REGEX_INCLUDE` and `<LINTER_KEY>_FILTER_REGEX_EXCLUDE`
11
+
If you need to lint only a folder or exclude some files from linting, you can use the optional environment parameters `FILTER_REGEX_INCLUDE` and `FILTER_REGEX_EXCLUDE`.
12
+
You can apply filters to a single linter by defining the variables `<LINTER_KEY>_FILTER_REGEX_INCLUDE` and `<LINTER_KEY>_FILTER_REGEX_EXCLUDE`.
13
13
14
14
Examples:
15
15
16
16
- Lint only src folder: `FILTER_REGEX_INCLUDE: (src/)`
17
17
- Don't lint files inside test and example folders: `FILTER_REGEX_EXCLUDE: (test/|examples/)`
18
18
- Don't lint javascript files inside test folder: `FILTER_REGEX_EXCLUDE: (test/.*\.js)`
19
19
20
-
Warning: not applicable with linters using CLI lint mode `project` ([see details](config-cli-lint-mode.md))
20
+
Warning: Not applicable with linters using CLI lint mode `project` ([see details](config-cli-lint-mode.md)).
0 commit comments