Skip to content

Commit

Permalink
Allow to define linter_key**_COMMAND_REMOVE_ARGUMENTS** to remove a c…
Browse files Browse the repository at this point in the history
…ommand line argument internally added by MegaLinter (#2874)

* [automation] Auto-update linters version, help and documentation

* Add missing icon urls in descriptors

* Allow to define linter_key**_COMMAND_REMOVE_ARGUMENTS** to remove a command line argument internally added by MegaLinter

* [MegaLinter] Apply linters fixes

* Build doc

* [MegaLinter] Apply linters fixes

---------

Co-authored-by: nvuillam <[email protected]>
Co-authored-by: nvuillam <[email protected]>
  • Loading branch information
3 people authored Aug 9, 2023
1 parent 0e688aa commit d0d5715
Show file tree
Hide file tree
Showing 121 changed files with 20,598 additions and 18,574 deletions.
16 changes: 16 additions & 0 deletions .automation/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,11 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
f"| {linter.name}_ARGUMENTS | User custom arguments to add in linter CLI call<br/>"
f'Ex: `-s --foo "bar"` | |'
]
linter_doc_md += [
f"| {linter.name}_COMMAND_REMOVE_ARGUMENTS | User custom arguments to remove "
"from command line before calling the linter<br/>"
f'Ex: `-s --foo "bar"` | |'
]
# Files can be filtered only in cli_lint_mode is file or list_of_files
if linter.cli_lint_mode != "project":
linter_doc_md += [
Expand Down Expand Up @@ -1450,6 +1455,17 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
]
add_in_config_schema_file(
[
[
f"{linter.name}_COMMAND_REMOVE_ARGUMENTS",
{
"$id": f"#/properties/{linter.name}_COMMAND_REMOVE_ARGUMENTS",
"type": ["array", "string"],
"title": f"{title_prefix}{linter.name}: Custom remove arguments",
"description": f"{linter.name}: User custom arguments to remove before calling linter",
"examples:": ["--foo", "bar"],
"items": {"type": "string"},
},
],
[
f"{linter.name}_ARGUMENTS",
{
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-linter.yml file, or with `oxsecurity/megalinter:beta` docker image

- Features
- Allow to define linter_key**_COMMAND_REMOVE_ARGUMENTS** to remove a command line argument internally added by MegaLinter

- Redis reporter
- Return URL of linter icons when available, in property `iconPngUrl`

Expand Down
1 change: 1 addition & 0 deletions docs/descriptors/action_actionlint.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Static checker for GitHub Actions workflow files
| Variable | Description | Default value |
|-----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------|
| ACTION_ACTIONLINT_ARGUMENTS | User custom arguments to add in linter CLI call<br/>Ex: `-s --foo "bar"` | |
| ACTION_ACTIONLINT_COMMAND_REMOVE_ARGUMENTS | User custom arguments to remove from command line before calling the linter<br/>Ex: `-s --foo "bar"` | |
| ACTION_ACTIONLINT_FILTER_REGEX_INCLUDE | Custom regex including filter<br/>Ex: `(src\|lib)` | Include every file |
| ACTION_ACTIONLINT_FILTER_REGEX_EXCLUDE | Custom regex excluding filter<br/>Ex: `(test\|examples)` | Exclude no file |
| ACTION_ACTIONLINT_CLI_LINT_MODE | Override default CLI lint mode<br/>- `file`: Calls the linter for each file<br/>- `list_of_files`: Call the linter with the list of files as argument<br/>- `project`: Call the linter from the root of the project | `list_of_files` |
Expand Down
1 change: 1 addition & 0 deletions docs/descriptors/ansible_ansible_lint.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ description: How to use ansible-lint (configure, ignore files, ignore errors, he
| Variable | Description | Default value |
|--------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------|
| ANSIBLE_ANSIBLE_LINT_ARGUMENTS | User custom arguments to add in linter CLI call<br/>Ex: `-s --foo "bar"` | |
| ANSIBLE_ANSIBLE_LINT_COMMAND_REMOVE_ARGUMENTS | User custom arguments to remove from command line before calling the linter<br/>Ex: `-s --foo "bar"` | |
| ANSIBLE_ANSIBLE_LINT_FILE_EXTENSIONS | Allowed file extensions. `"*"` matches any extension, `""` matches empty extension. Empty list excludes all files<br/>Ex: `[".py", ""]` | `[".yml", ".yaml"]` |
| ANSIBLE_ANSIBLE_LINT_FILE_NAMES_REGEX | File name regex filters. Regular expression list for filtering files by their base names using regex full match. Empty list includes all files<br/>Ex: `["Dockerfile(-.+)?", "Jenkinsfile"]` | Include every file |
| ANSIBLE_ANSIBLE_LINT_PRE_COMMANDS | List of bash commands to run before the linter | None |
Expand Down
1 change: 1 addition & 0 deletions docs/descriptors/arm_arm_ttk.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ description: How to use arm-ttk (configure, ignore files, ignore errors, help &
| Variable | Description | Default value |
|-----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------|
| ARM_ARM_TTK_ARGUMENTS | User custom arguments to add in linter CLI call<br/>Ex: `-s --foo "bar"` | |
| ARM_ARM_TTK_COMMAND_REMOVE_ARGUMENTS | User custom arguments to remove from command line before calling the linter<br/>Ex: `-s --foo "bar"` | |
| ARM_ARM_TTK_FILTER_REGEX_INCLUDE | Custom regex including filter<br/>Ex: `(src\|lib)` | Include every file |
| ARM_ARM_TTK_FILTER_REGEX_EXCLUDE | Custom regex excluding filter<br/>Ex: `(test\|examples)` | Exclude no file |
| ARM_ARM_TTK_CLI_LINT_MODE | Override default CLI lint mode<br/>- `file`: Calls the linter for each file<br/>- `project`: Call the linter from the root of the project | `file` |
Expand Down
1 change: 1 addition & 0 deletions docs/descriptors/bash_bash_exec.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Note: You can run `git add --chmod=+x myfile.sh` to make a file executable on Wi
|---------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| ERROR_ON_MISSING_EXEC_BIT | If set to `false`, the `bash-exec` linter will report a warning if a shell script is not executable. If set to `true`, the `bash-exec` linter will report an error instead | `false` |
| BASH_EXEC_ARGUMENTS | User custom arguments to add in linter CLI call<br/>Ex: `-s --foo "bar"` | |
| BASH_EXEC_COMMAND_REMOVE_ARGUMENTS | User custom arguments to remove from command line before calling the linter<br/>Ex: `-s --foo "bar"` | |
| BASH_EXEC_FILTER_REGEX_INCLUDE | Custom regex including filter<br/>Ex: `(src\|lib)` | Include every file |
| BASH_EXEC_FILTER_REGEX_EXCLUDE | Custom regex excluding filter<br/>Ex: `(test\|examples)` | Exclude no file |
| BASH_EXEC_CLI_LINT_MODE | Override default CLI lint mode<br/>- `file`: Calls the linter for each file<br/>- `project`: Call the linter from the root of the project | `file` |
Expand Down
1 change: 1 addition & 0 deletions docs/descriptors/bash_shellcheck.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ description: How to use shellcheck (configure, ignore files, ignore errors, help
| Variable | Description | Default value |
|---------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| BASH_SHELLCHECK_ARGUMENTS | User custom arguments to add in linter CLI call<br/>Ex: `-s --foo "bar"` | |
| BASH_SHELLCHECK_COMMAND_REMOVE_ARGUMENTS | User custom arguments to remove from command line before calling the linter<br/>Ex: `-s --foo "bar"` | |
| BASH_SHELLCHECK_FILTER_REGEX_INCLUDE | Custom regex including filter<br/>Ex: `(src\|lib)` | Include every file |
| BASH_SHELLCHECK_FILTER_REGEX_EXCLUDE | Custom regex excluding filter<br/>Ex: `(test\|examples)` | Exclude no file |
| BASH_SHELLCHECK_CLI_LINT_MODE | Override default CLI lint mode<br/>- `file`: Calls the linter for each file<br/>- `list_of_files`: Call the linter with the list of files as argument<br/>- `project`: Call the linter from the root of the project | `list_of_files` |
Expand Down
1 change: 1 addition & 0 deletions docs/descriptors/bash_shfmt.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ description: How to use shfmt (configure, ignore files, ignore errors, help & ve
| Variable | Description | Default value |
|----------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| BASH_SHFMT_ARGUMENTS | User custom arguments to add in linter CLI call<br/>Ex: `-s --foo "bar"` | |
| BASH_SHFMT_COMMAND_REMOVE_ARGUMENTS | User custom arguments to remove from command line before calling the linter<br/>Ex: `-s --foo "bar"` | |
| BASH_SHFMT_FILTER_REGEX_INCLUDE | Custom regex including filter<br/>Ex: `(src\|lib)` | Include every file |
| BASH_SHFMT_FILTER_REGEX_EXCLUDE | Custom regex excluding filter<br/>Ex: `(test\|examples)` | Exclude no file |
| BASH_SHFMT_CLI_LINT_MODE | Override default CLI lint mode<br/>- `file`: Calls the linter for each file<br/>- `list_of_files`: Call the linter with the list of files as argument<br/>- `project`: Call the linter from the root of the project | `list_of_files` |
Expand Down
1 change: 1 addition & 0 deletions docs/descriptors/bicep_bicep_linter.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use a `bicepconfig.json` file. For more information, see the [documentation for
| Variable | Description | Default value |
|------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|
| BICEP_BICEP_LINTER_ARGUMENTS | User custom arguments to add in linter CLI call<br/>Ex: `-s --foo "bar"` | |
| BICEP_BICEP_LINTER_COMMAND_REMOVE_ARGUMENTS | User custom arguments to remove from command line before calling the linter<br/>Ex: `-s --foo "bar"` | |
| BICEP_BICEP_LINTER_FILTER_REGEX_INCLUDE | Custom regex including filter<br/>Ex: `(src\|lib)` | Include every file |
| BICEP_BICEP_LINTER_FILTER_REGEX_EXCLUDE | Custom regex excluding filter<br/>Ex: `(test\|examples)` | Exclude no file |
| BICEP_BICEP_LINTER_CLI_LINT_MODE | Override default CLI lint mode<br/>- `file`: Calls the linter for each file<br/>- `project`: Call the linter from the root of the project | `file` |
Expand Down
1 change: 1 addition & 0 deletions docs/descriptors/c_cpplint.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ description: How to use cpplint (configure, ignore files, ignore errors, help &
| Variable | Description | Default value |
|---------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|
| C_CPPLINT_ARGUMENTS | User custom arguments to add in linter CLI call<br/>Ex: `-s --foo "bar"` | |
| C_CPPLINT_COMMAND_REMOVE_ARGUMENTS | User custom arguments to remove from command line before calling the linter<br/>Ex: `-s --foo "bar"` | |
| C_CPPLINT_FILTER_REGEX_INCLUDE | Custom regex including filter<br/>Ex: `(src\|lib)` | Include every file |
| C_CPPLINT_FILTER_REGEX_EXCLUDE | Custom regex excluding filter<br/>Ex: `(test\|examples)` | Exclude no file |
| C_CPPLINT_CLI_LINT_MODE | Override default CLI lint mode<br/>- `file`: Calls the linter for each file<br/>- `list_of_files`: Call the linter with the list of files as argument<br/>- `project`: Call the linter from the root of the project | `list_of_files` |
Expand Down
Loading

0 comments on commit d0d5715

Please sign in to comment.