mega-linter-runner 9.5.0 → 9.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,22 +4,23 @@
4
4
  image: atlassian/default-image:5
5
5
 
6
6
  pipelines:
7
- default:
8
- - parallel:
9
- - step:
10
- name: Run MegaLinter
11
- image: <%= DOCKER_IMAGE_NAME %>:<%= DOCKER_IMAGE_VERSION %>
12
- script:
13
- # Disable LLM Advisor for bot PRs (dependabot, renovate, etc.)
14
- # Note: Bitbucket has limited access to PR metadata, this is a basic check
15
- - |
16
- if [[ "$BITBUCKET_BRANCH" =~ ^(dependabot|renovate)/ ]] ||
17
- [[ "$BITBUCKET_PR_TITLE" =~ ^(chore|fix|deps?|bump)(\(.*\))?: ]] ||
18
- [[ "$BITBUCKET_STEP_TRIGGERER_UUID" =~ dependabot|renovate ]]; then
19
- export LLM_ADVISOR_ENABLED=false
20
- else
21
- export LLM_ADVISOR_ENABLED=true
22
- fi
23
- - export DEFAULT_WORKSPACE=$BITBUCKET_CLONE_DIR && bash /entrypoint.sh
24
- artifacts:
25
- - megalinter-reports/**
7
+ pull-requests: # Note: Bitbucket PR comment reporting requires pull request context
8
+ "**": # Run on PRs for any branch (the source branch of the pull request)
9
+ - parallel:
10
+ - step:
11
+ name: Run MegaLinter
12
+ image: <%= DOCKER_IMAGE_NAME %>:<%= DOCKER_IMAGE_VERSION %>
13
+ script:
14
+ # Disable LLM Advisor for bot PRs (dependabot, renovate, etc.)
15
+ # Note: Bitbucket has limited access to PR metadata, this is a basic check
16
+ - |
17
+ if [[ "$BITBUCKET_BRANCH" =~ ^(dependabot|renovate)/ ]] ||
18
+ [[ "$BITBUCKET_PR_TITLE" =~ ^(chore|fix|deps?|bump)(\(.*\))?: ]] ||
19
+ [[ "$BITBUCKET_STEP_TRIGGERER_UUID" =~ dependabot|renovate ]]; then
20
+ export LLM_ADVISOR_ENABLED=false
21
+ else
22
+ export LLM_ADVISOR_ENABLED=true
23
+ fi
24
+ - export DEFAULT_WORKSPACE=$BITBUCKET_CLONE_DIR && bash /entrypoint.sh
25
+ artifacts:
26
+ - megalinter-reports/**
@@ -136,7 +136,7 @@ jobs:
136
136
  # Create pull request if applicable
137
137
  # (for now works only on PR from same repository, not from forks)
138
138
  - name: Create Pull Request with applied fixes
139
- uses: peter-evans/create-pull-request@v7
139
+ uses: peter-evans/create-pull-request@v8
140
140
  id: cpr
141
141
  if: >-
142
142
  steps.ml.outputs.has_updated_sources == 1 &&
@@ -9,9 +9,6 @@ runs:
9
9
  using: "docker"
10
10
  # You can manually update the Docker image version here, or use the latest tag
11
11
  image: "docker://<%= DOCKER_IMAGE_VERSION %>"
12
- args:
13
- - "-v"
14
- - "/var/run/docker.sock:/var/run/docker.sock:rw"
15
12
  branding:
16
13
  icon: "check"
17
14
  color: "green"
package/lib/cli.js CHANGED
@@ -1,4 +1,3 @@
1
- #! /usr/bin/env node
2
1
  import { MegaLinterRunner } from "./runner.js";
3
2
  import {optionsDefinition} from "./options.js";
4
3
 
package/lib/index.js CHANGED
File without changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "_meta": {
3
- "variable_count": 2363,
3
+ "variable_count": 2375,
4
4
  "categories": {
5
5
  "ACTION": 4,
6
6
  "ACTION_ACTIONLINT": 16,
@@ -54,7 +54,7 @@
54
54
  "ENV": 4,
55
55
  "ENV_DOTENV_LINTER": 13,
56
56
  "FILEIO_REPORTER": 2,
57
- "GENERAL": 51,
57
+ "GENERAL": 52,
58
58
  "GHERKIN": 4,
59
59
  "GHERKIN_GHERKIN_LINT": 15,
60
60
  "GITHUB_COMMENT_REPORTER": 5,
@@ -135,6 +135,7 @@
135
135
  "RAKU": 4,
136
136
  "RAKU_RAKU": 15,
137
137
  "REPOSITORY": 12,
138
+ "REPOSITORY_BETTERLEAKS": 11,
138
139
  "REPOSITORY_CHECKOV": 11,
139
140
  "REPOSITORY_DEVSKIM": 11,
140
141
  "REPOSITORY_DUSTILOCK": 9,
@@ -1218,6 +1219,7 @@
1218
1219
  "PYTHON_RUFF",
1219
1220
  "PYTHON_RUFF_FORMAT",
1220
1221
  "RAKU_RAKU",
1222
+ "REPOSITORY_BETTERLEAKS",
1221
1223
  "REPOSITORY_CHECKOV",
1222
1224
  "REPOSITORY_DEVSKIM",
1223
1225
  "REPOSITORY_DUSTILOCK",
@@ -5906,6 +5908,7 @@
5906
5908
  "PYTHON_RUFF",
5907
5909
  "PYTHON_RUFF_FORMAT",
5908
5910
  "RAKU_RAKU",
5911
+ "REPOSITORY_BETTERLEAKS",
5909
5912
  "REPOSITORY_CHECKOV",
5910
5913
  "REPOSITORY_DEVSKIM",
5911
5914
  "REPOSITORY_DUSTILOCK",
@@ -6071,6 +6074,7 @@
6071
6074
  "PYTHON_RUFF",
6072
6075
  "PYTHON_RUFF_FORMAT",
6073
6076
  "RAKU_RAKU",
6077
+ "REPOSITORY_BETTERLEAKS",
6074
6078
  "REPOSITORY_CHECKOV",
6075
6079
  "REPOSITORY_DEVSKIM",
6076
6080
  "REPOSITORY_DUSTILOCK",
@@ -6864,6 +6868,19 @@
6864
6868
  "YAML"
6865
6869
  ]
6866
6870
  },
6871
+ "ENABLE_DISABLE_LINTERS_PRIORITY": {
6872
+ "name": "ENABLE_DISABLE_LINTERS_PRIORITY",
6873
+ "type": "string",
6874
+ "title": "ENABLE_LINTERS / DISABLE_LINTERS priority",
6875
+ "description": "Defines which list wins when a linter is present in both ENABLE_LINTERS and DISABLE_LINTERS. ENABLE (default) keeps the linter active, DISABLE lets DISABLE_LINTERS override ENABLE_LINTERS (useful to trim an inherited ENABLE_LINTERS list via EXTENDS)",
6876
+ "default": "ENABLE",
6877
+ "enum": [
6878
+ "ENABLE",
6879
+ "DISABLE"
6880
+ ],
6881
+ "category": "GENERAL",
6882
+ "section": "ACTIVATION"
6883
+ },
6867
6884
  "ENABLE_ERRORS_LINTERS": {
6868
6885
  "name": "ENABLE_ERRORS_LINTERS",
6869
6886
  "type": "array",
@@ -6967,6 +6984,7 @@
6967
6984
  "PYTHON_RUFF",
6968
6985
  "PYTHON_RUFF_FORMAT",
6969
6986
  "RAKU_RAKU",
6987
+ "REPOSITORY_BETTERLEAKS",
6970
6988
  "REPOSITORY_CHECKOV",
6971
6989
  "REPOSITORY_DEVSKIM",
6972
6990
  "REPOSITORY_DUSTILOCK",
@@ -7132,6 +7150,7 @@
7132
7150
  "PYTHON_RUFF",
7133
7151
  "PYTHON_RUFF_FORMAT",
7134
7152
  "RAKU_RAKU",
7153
+ "REPOSITORY_BETTERLEAKS",
7135
7154
  "REPOSITORY_CHECKOV",
7136
7155
  "REPOSITORY_DEVSKIM",
7137
7156
  "REPOSITORY_DUSTILOCK",
@@ -10073,7 +10092,7 @@
10073
10092
  "array",
10074
10093
  "string"
10075
10094
  ],
10076
- "title": "JSON_ESLINT_PLUGIN_JSONC: Custom arguments",
10095
+ "title": "(deprecated) JSON_ESLINT_PLUGIN_JSONC: Custom arguments",
10077
10096
  "description": "JSON_ESLINT_PLUGIN_JSONC: User custom arguments to add in linter CLI call",
10078
10097
  "category": "JSON_ESLINT_PLUGIN_JSONC",
10079
10098
  "section": "LINTER_COMMAND",
@@ -10082,7 +10101,7 @@
10082
10101
  "JSON_ESLINT_PLUGIN_JSONC_CLI_EXECUTABLE": {
10083
10102
  "name": "JSON_ESLINT_PLUGIN_JSONC_CLI_EXECUTABLE",
10084
10103
  "type": "array",
10085
- "title": "JSON_ESLINT_PLUGIN_JSONC: CLI Executable",
10104
+ "title": "(deprecated) JSON_ESLINT_PLUGIN_JSONC: CLI Executable",
10086
10105
  "description": "JSON_ESLINT_PLUGIN_JSONC: Override CLI executable used to build the linter command line (rarely needed)",
10087
10106
  "default": [
10088
10107
  [
@@ -10096,7 +10115,7 @@
10096
10115
  "JSON_ESLINT_PLUGIN_JSONC_CLI_LINT_MODE": {
10097
10116
  "name": "JSON_ESLINT_PLUGIN_JSONC_CLI_LINT_MODE",
10098
10117
  "type": "string",
10099
- "title": "JSON_ESLINT_PLUGIN_JSONC: CLI lint mode",
10118
+ "title": "(deprecated) JSON_ESLINT_PLUGIN_JSONC: CLI lint mode",
10100
10119
  "description": "JSON_ESLINT_PLUGIN_JSONC: Override default CLI lint mode used to call the linter (rarely needed)",
10101
10120
  "default": "list_of_files",
10102
10121
  "enum": [
@@ -10113,7 +10132,7 @@
10113
10132
  "array",
10114
10133
  "string"
10115
10134
  ],
10116
- "title": "JSON_ESLINT_PLUGIN_JSONC: Custom remove arguments",
10135
+ "title": "(deprecated) JSON_ESLINT_PLUGIN_JSONC: Custom remove arguments",
10117
10136
  "description": "JSON_ESLINT_PLUGIN_JSONC: User custom arguments to remove before calling linter",
10118
10137
  "category": "JSON_ESLINT_PLUGIN_JSONC",
10119
10138
  "section": "LINTER_COMMAND",
@@ -10122,7 +10141,7 @@
10122
10141
  "JSON_ESLINT_PLUGIN_JSONC_CONFIG_FILE": {
10123
10142
  "name": "JSON_ESLINT_PLUGIN_JSONC_CONFIG_FILE",
10124
10143
  "type": "string",
10125
- "title": "JSON_ESLINT_PLUGIN_JSONC: Custom config file name",
10144
+ "title": "(deprecated) JSON_ESLINT_PLUGIN_JSONC: Custom config file name",
10126
10145
  "description": "JSON_ESLINT_PLUGIN_JSONC: User custom config file name if different from default",
10127
10146
  "default": ".eslintrc-json.json",
10128
10147
  "category": "JSON_ESLINT_PLUGIN_JSONC",
@@ -10131,7 +10150,7 @@
10131
10150
  "JSON_ESLINT_PLUGIN_JSONC_DISABLE_ERRORS": {
10132
10151
  "name": "JSON_ESLINT_PLUGIN_JSONC_DISABLE_ERRORS",
10133
10152
  "type": "boolean",
10134
- "title": "JSON_ESLINT_PLUGIN_JSONC: Disable errors",
10153
+ "title": "(deprecated) JSON_ESLINT_PLUGIN_JSONC: Disable errors",
10135
10154
  "description": "JSON_ESLINT_PLUGIN_JSONC: If true, JSON_ESLINT_PLUGIN_JSONC doesn't make MegaLinter fail even if errors are found",
10136
10155
  "default": false,
10137
10156
  "category": "JSON_ESLINT_PLUGIN_JSONC",
@@ -10140,7 +10159,7 @@
10140
10159
  "JSON_ESLINT_PLUGIN_JSONC_DISABLE_ERRORS_IF_LESS_THAN": {
10141
10160
  "name": "JSON_ESLINT_PLUGIN_JSONC_DISABLE_ERRORS_IF_LESS_THAN",
10142
10161
  "type": "number",
10143
- "title": "JSON_ESLINT_PLUGIN_JSONC: Maximum number of errors allowed",
10162
+ "title": "(deprecated) JSON_ESLINT_PLUGIN_JSONC: Maximum number of errors allowed",
10144
10163
  "description": "JSON_ESLINT_PLUGIN_JSONC: If the number of errors found is less than this value, JSON_ESLINT_PLUGIN_JSONC doesn't make MegaLinter fail",
10145
10164
  "default": 0,
10146
10165
  "category": "JSON_ESLINT_PLUGIN_JSONC",
@@ -10149,7 +10168,7 @@
10149
10168
  "JSON_ESLINT_PLUGIN_JSONC_FILE_EXTENSIONS": {
10150
10169
  "name": "JSON_ESLINT_PLUGIN_JSONC_FILE_EXTENSIONS",
10151
10170
  "type": "array",
10152
- "title": "JSON_ESLINT_PLUGIN_JSONC: Matching files extensions",
10171
+ "title": "(deprecated) JSON_ESLINT_PLUGIN_JSONC: Matching files extensions",
10153
10172
  "description": "JSON_ESLINT_PLUGIN_JSONC: Override descriptor/linter matching files extensions that will be used to select files to lint",
10154
10173
  "default": [
10155
10174
  ".json",
@@ -10167,7 +10186,7 @@
10167
10186
  "JSON_ESLINT_PLUGIN_JSONC_FILE_NAMES_REGEX": {
10168
10187
  "name": "JSON_ESLINT_PLUGIN_JSONC_FILE_NAMES_REGEX",
10169
10188
  "type": "array",
10170
- "title": "JSON_ESLINT_PLUGIN_JSONC: Matching file name regexes",
10189
+ "title": "(deprecated) JSON_ESLINT_PLUGIN_JSONC: Matching file name regexes",
10171
10190
  "description": "JSON_ESLINT_PLUGIN_JSONC: Override descriptor/linter matching file name regexes that will be used to select files to lint",
10172
10191
  "default": [],
10173
10192
  "examples": [
@@ -10181,7 +10200,7 @@
10181
10200
  "JSON_ESLINT_PLUGIN_JSONC_FILTER_REGEX_EXCLUDE": {
10182
10201
  "name": "JSON_ESLINT_PLUGIN_JSONC_FILTER_REGEX_EXCLUDE",
10183
10202
  "type": "string",
10184
- "title": "JSON_ESLINT_PLUGIN_JSONC: Excluding Regex",
10203
+ "title": "(deprecated) JSON_ESLINT_PLUGIN_JSONC: Excluding Regex",
10185
10204
  "description": "JSON_ESLINT_PLUGIN_JSONC: Custom regex excluding filter: files matching this regex will NOT be linted",
10186
10205
  "category": "JSON_ESLINT_PLUGIN_JSONC",
10187
10206
  "section": "SCOPE"
@@ -10189,7 +10208,7 @@
10189
10208
  "JSON_ESLINT_PLUGIN_JSONC_FILTER_REGEX_INCLUDE": {
10190
10209
  "name": "JSON_ESLINT_PLUGIN_JSONC_FILTER_REGEX_INCLUDE",
10191
10210
  "type": "string",
10192
- "title": "JSON_ESLINT_PLUGIN_JSONC: Including Regex",
10211
+ "title": "(deprecated) JSON_ESLINT_PLUGIN_JSONC: Including Regex",
10193
10212
  "description": "JSON_ESLINT_PLUGIN_JSONC: Custom regex including filter: only files matching this regex will be linted",
10194
10213
  "category": "JSON_ESLINT_PLUGIN_JSONC",
10195
10214
  "section": "SCOPE"
@@ -10198,7 +10217,7 @@
10198
10217
  "name": "JSON_ESLINT_PLUGIN_JSONC_POST_COMMANDS",
10199
10218
  "type": "array",
10200
10219
  "title": "JSON_ESLINT_PLUGIN_JSONC: Post-run commands",
10201
- "description": "JSON_ESLINT_PLUGIN_JSONC: Define bash commands to run after running JSON_ESLINT_PLUGIN_JSONC",
10220
+ "description": "(deprecated) JSON_ESLINT_PLUGIN_JSONC: Define bash commands to run after running JSON_ESLINT_PLUGIN_JSONC",
10202
10221
  "examples": [
10203
10222
  [
10204
10223
  {
@@ -10215,7 +10234,7 @@
10215
10234
  "name": "JSON_ESLINT_PLUGIN_JSONC_PRE_COMMANDS",
10216
10235
  "type": "array",
10217
10236
  "title": "JSON_ESLINT_PLUGIN_JSONC: Pre-run commands",
10218
- "description": "JSON_ESLINT_PLUGIN_JSONC: Define bash commands to run before running JSON_ESLINT_PLUGIN_JSONC",
10237
+ "description": "(deprecated) JSON_ESLINT_PLUGIN_JSONC: Define bash commands to run before running JSON_ESLINT_PLUGIN_JSONC",
10219
10238
  "examples": [
10220
10239
  [
10221
10240
  {
@@ -10231,7 +10250,7 @@
10231
10250
  "JSON_ESLINT_PLUGIN_JSONC_RULES_PATH": {
10232
10251
  "name": "JSON_ESLINT_PLUGIN_JSONC_RULES_PATH",
10233
10252
  "type": "string",
10234
- "title": "JSON_ESLINT_PLUGIN_JSONC: Custom config file path",
10253
+ "title": "(deprecated) JSON_ESLINT_PLUGIN_JSONC: Custom config file path",
10235
10254
  "description": "JSON_ESLINT_PLUGIN_JSONC: Path where to find linter configuration file",
10236
10255
  "category": "JSON_ESLINT_PLUGIN_JSONC",
10237
10256
  "section": "LINTER_COMMAND"
@@ -10239,7 +10258,7 @@
10239
10258
  "JSON_ESLINT_PLUGIN_JSONC_UNSECURED_ENV_VARIABLES": {
10240
10259
  "name": "JSON_ESLINT_PLUGIN_JSONC_UNSECURED_ENV_VARIABLES",
10241
10260
  "type": "array",
10242
- "title": "JSON_ESLINT_PLUGIN_JSONC: Unsecured env variables",
10261
+ "title": "(deprecated) JSON_ESLINT_PLUGIN_JSONC: Unsecured env variables",
10243
10262
  "description": "List of env variables explicitly not filtered before calling JSON_ESLINT_PLUGIN_JSONC and its pre/post commands",
10244
10263
  "default": [],
10245
10264
  "category": "JSON_ESLINT_PLUGIN_JSONC",
@@ -12619,6 +12638,7 @@
12619
12638
  "PYTHON_RUFF",
12620
12639
  "PYTHON_RUFF_FORMAT",
12621
12640
  "RAKU_RAKU",
12641
+ "REPOSITORY_BETTERLEAKS",
12622
12642
  "REPOSITORY_CHECKOV",
12623
12643
  "REPOSITORY_DEVSKIM",
12624
12644
  "REPOSITORY_DUSTILOCK",
@@ -12797,6 +12817,7 @@
12797
12817
  "PYTHON_RUFF",
12798
12818
  "PYTHON_RUFF_FORMAT",
12799
12819
  "RAKU_RAKU",
12820
+ "REPOSITORY_BETTERLEAKS",
12800
12821
  "REPOSITORY_CHECKOV",
12801
12822
  "REPOSITORY_DEVSKIM",
12802
12823
  "REPOSITORY_DUSTILOCK",
@@ -16189,7 +16210,7 @@
16189
16210
  "description": "POWERSHELL_POWERSHELL: Override CLI executable used to build the linter command line (rarely needed)",
16190
16211
  "default": [
16191
16212
  [
16192
- "powershell"
16213
+ "pwsh"
16193
16214
  ]
16194
16215
  ],
16195
16216
  "category": "POWERSHELL_POWERSHELL",
@@ -16319,7 +16340,7 @@
16319
16340
  "description": "POWERSHELL_POWERSHELL_FORMATTER: Override CLI executable used to build the linter command line (rarely needed)",
16320
16341
  "default": [
16321
16342
  [
16322
- "powershell"
16343
+ "pwsh"
16323
16344
  ]
16324
16345
  ],
16325
16346
  "category": "POWERSHELL_POWERSHELL_FORMATTER",
@@ -19171,6 +19192,137 @@
19171
19192
  "category": "GENERAL",
19172
19193
  "section": "OUTPUT"
19173
19194
  },
19195
+ "REPOSITORY_BETTERLEAKS_ARGUMENTS": {
19196
+ "name": "REPOSITORY_BETTERLEAKS_ARGUMENTS",
19197
+ "type": [
19198
+ "array",
19199
+ "string"
19200
+ ],
19201
+ "title": "REPOSITORY_BETTERLEAKS: Custom arguments",
19202
+ "description": "REPOSITORY_BETTERLEAKS: User custom arguments to add in linter CLI call",
19203
+ "category": "REPOSITORY_BETTERLEAKS",
19204
+ "section": "LINTER_COMMAND",
19205
+ "items_type": "string"
19206
+ },
19207
+ "REPOSITORY_BETTERLEAKS_CLI_EXECUTABLE": {
19208
+ "name": "REPOSITORY_BETTERLEAKS_CLI_EXECUTABLE",
19209
+ "type": "array",
19210
+ "title": "REPOSITORY_BETTERLEAKS: CLI Executable",
19211
+ "description": "REPOSITORY_BETTERLEAKS: Override CLI executable used to build the linter command line (rarely needed)",
19212
+ "default": [
19213
+ [
19214
+ "betterleaks"
19215
+ ]
19216
+ ],
19217
+ "category": "REPOSITORY_BETTERLEAKS",
19218
+ "section": "LINTER_COMMAND",
19219
+ "items_type": "string"
19220
+ },
19221
+ "REPOSITORY_BETTERLEAKS_CLI_LINT_MODE": {
19222
+ "name": "REPOSITORY_BETTERLEAKS_CLI_LINT_MODE",
19223
+ "type": "string",
19224
+ "title": "REPOSITORY_BETTERLEAKS: CLI lint mode",
19225
+ "description": "REPOSITORY_BETTERLEAKS: Override default CLI lint mode used to call the linter (rarely needed)",
19226
+ "default": "project",
19227
+ "enum": [
19228
+ "file",
19229
+ "list_of_files",
19230
+ "project"
19231
+ ],
19232
+ "category": "REPOSITORY_BETTERLEAKS",
19233
+ "section": "LINTER_COMMAND"
19234
+ },
19235
+ "REPOSITORY_BETTERLEAKS_COMMAND_REMOVE_ARGUMENTS": {
19236
+ "name": "REPOSITORY_BETTERLEAKS_COMMAND_REMOVE_ARGUMENTS",
19237
+ "type": [
19238
+ "array",
19239
+ "string"
19240
+ ],
19241
+ "title": "REPOSITORY_BETTERLEAKS: Custom remove arguments",
19242
+ "description": "REPOSITORY_BETTERLEAKS: User custom arguments to remove before calling linter",
19243
+ "category": "REPOSITORY_BETTERLEAKS",
19244
+ "section": "LINTER_COMMAND",
19245
+ "items_type": "string"
19246
+ },
19247
+ "REPOSITORY_BETTERLEAKS_CONFIG_FILE": {
19248
+ "name": "REPOSITORY_BETTERLEAKS_CONFIG_FILE",
19249
+ "type": "string",
19250
+ "title": "REPOSITORY_BETTERLEAKS: Custom config file name",
19251
+ "description": "REPOSITORY_BETTERLEAKS: User custom config file name if different from default",
19252
+ "default": ".betterleaks.toml",
19253
+ "category": "REPOSITORY_BETTERLEAKS",
19254
+ "section": "LINTER_COMMAND"
19255
+ },
19256
+ "REPOSITORY_BETTERLEAKS_DISABLE_ERRORS": {
19257
+ "name": "REPOSITORY_BETTERLEAKS_DISABLE_ERRORS",
19258
+ "type": "boolean",
19259
+ "title": "REPOSITORY_BETTERLEAKS: Disable errors",
19260
+ "description": "REPOSITORY_BETTERLEAKS: If true, REPOSITORY_BETTERLEAKS doesn't make MegaLinter fail even if errors are found",
19261
+ "default": false,
19262
+ "category": "REPOSITORY_BETTERLEAKS",
19263
+ "section": "ERRORS"
19264
+ },
19265
+ "REPOSITORY_BETTERLEAKS_DISABLE_ERRORS_IF_LESS_THAN": {
19266
+ "name": "REPOSITORY_BETTERLEAKS_DISABLE_ERRORS_IF_LESS_THAN",
19267
+ "type": "number",
19268
+ "title": "REPOSITORY_BETTERLEAKS: Maximum number of errors allowed",
19269
+ "description": "REPOSITORY_BETTERLEAKS: If the number of errors found is less than this value, REPOSITORY_BETTERLEAKS doesn't make MegaLinter fail",
19270
+ "default": 0,
19271
+ "category": "REPOSITORY_BETTERLEAKS",
19272
+ "section": "ERRORS"
19273
+ },
19274
+ "REPOSITORY_BETTERLEAKS_POST_COMMANDS": {
19275
+ "name": "REPOSITORY_BETTERLEAKS_POST_COMMANDS",
19276
+ "type": "array",
19277
+ "title": "REPOSITORY_BETTERLEAKS: Post-run commands",
19278
+ "description": "REPOSITORY_BETTERLEAKS: Define bash commands to run after running REPOSITORY_BETTERLEAKS",
19279
+ "examples": [
19280
+ [
19281
+ {
19282
+ "command": "npm run test",
19283
+ "continue_if_failed": false,
19284
+ "cwd": "workspace"
19285
+ }
19286
+ ]
19287
+ ],
19288
+ "category": "REPOSITORY_BETTERLEAKS",
19289
+ "section": "PREPOSTCOMMANDS"
19290
+ },
19291
+ "REPOSITORY_BETTERLEAKS_PRE_COMMANDS": {
19292
+ "name": "REPOSITORY_BETTERLEAKS_PRE_COMMANDS",
19293
+ "type": "array",
19294
+ "title": "REPOSITORY_BETTERLEAKS: Pre-run commands",
19295
+ "description": "REPOSITORY_BETTERLEAKS: Define bash commands to run before running REPOSITORY_BETTERLEAKS",
19296
+ "examples": [
19297
+ [
19298
+ {
19299
+ "command": "tflint --init",
19300
+ "continue_if_failed": false,
19301
+ "cwd": "workspace"
19302
+ }
19303
+ ]
19304
+ ],
19305
+ "category": "REPOSITORY_BETTERLEAKS",
19306
+ "section": "PREPOSTCOMMANDS"
19307
+ },
19308
+ "REPOSITORY_BETTERLEAKS_RULES_PATH": {
19309
+ "name": "REPOSITORY_BETTERLEAKS_RULES_PATH",
19310
+ "type": "string",
19311
+ "title": "REPOSITORY_BETTERLEAKS: Custom config file path",
19312
+ "description": "REPOSITORY_BETTERLEAKS: Path where to find linter configuration file",
19313
+ "category": "REPOSITORY_BETTERLEAKS",
19314
+ "section": "LINTER_COMMAND"
19315
+ },
19316
+ "REPOSITORY_BETTERLEAKS_UNSECURED_ENV_VARIABLES": {
19317
+ "name": "REPOSITORY_BETTERLEAKS_UNSECURED_ENV_VARIABLES",
19318
+ "type": "array",
19319
+ "title": "REPOSITORY_BETTERLEAKS: Unsecured env variables",
19320
+ "description": "List of env variables explicitly not filtered before calling REPOSITORY_BETTERLEAKS and its pre/post commands",
19321
+ "default": [],
19322
+ "category": "REPOSITORY_BETTERLEAKS",
19323
+ "section": "SECURITY",
19324
+ "items_type": "string"
19325
+ },
19174
19326
  "REPOSITORY_CHECKOV_ARGUMENTS": {
19175
19327
  "name": "REPOSITORY_CHECKOV_ARGUMENTS",
19176
19328
  "type": [
@@ -19569,7 +19721,7 @@
19569
19721
  "array",
19570
19722
  "string"
19571
19723
  ],
19572
- "title": "REPOSITORY_GITLEAKS: Custom arguments",
19724
+ "title": "(deprecated) REPOSITORY_GITLEAKS: Custom arguments",
19573
19725
  "description": "REPOSITORY_GITLEAKS: User custom arguments to add in linter CLI call",
19574
19726
  "category": "REPOSITORY_GITLEAKS",
19575
19727
  "section": "LINTER_COMMAND",
@@ -19578,7 +19730,7 @@
19578
19730
  "REPOSITORY_GITLEAKS_CLI_EXECUTABLE": {
19579
19731
  "name": "REPOSITORY_GITLEAKS_CLI_EXECUTABLE",
19580
19732
  "type": "array",
19581
- "title": "REPOSITORY_GITLEAKS: CLI Executable",
19733
+ "title": "(deprecated) REPOSITORY_GITLEAKS: CLI Executable",
19582
19734
  "description": "REPOSITORY_GITLEAKS: Override CLI executable used to build the linter command line (rarely needed)",
19583
19735
  "default": [
19584
19736
  [
@@ -19592,7 +19744,7 @@
19592
19744
  "REPOSITORY_GITLEAKS_CLI_LINT_MODE": {
19593
19745
  "name": "REPOSITORY_GITLEAKS_CLI_LINT_MODE",
19594
19746
  "type": "string",
19595
- "title": "REPOSITORY_GITLEAKS: CLI lint mode",
19747
+ "title": "(deprecated) REPOSITORY_GITLEAKS: CLI lint mode",
19596
19748
  "description": "REPOSITORY_GITLEAKS: Override default CLI lint mode used to call the linter (rarely needed)",
19597
19749
  "default": "project",
19598
19750
  "enum": [
@@ -19609,7 +19761,7 @@
19609
19761
  "array",
19610
19762
  "string"
19611
19763
  ],
19612
- "title": "REPOSITORY_GITLEAKS: Custom remove arguments",
19764
+ "title": "(deprecated) REPOSITORY_GITLEAKS: Custom remove arguments",
19613
19765
  "description": "REPOSITORY_GITLEAKS: User custom arguments to remove before calling linter",
19614
19766
  "category": "REPOSITORY_GITLEAKS",
19615
19767
  "section": "LINTER_COMMAND",
@@ -19618,7 +19770,7 @@
19618
19770
  "REPOSITORY_GITLEAKS_CONFIG_FILE": {
19619
19771
  "name": "REPOSITORY_GITLEAKS_CONFIG_FILE",
19620
19772
  "type": "string",
19621
- "title": "REPOSITORY_GITLEAKS: Custom config file name",
19773
+ "title": "(deprecated) REPOSITORY_GITLEAKS: Custom config file name",
19622
19774
  "description": "REPOSITORY_GITLEAKS: User custom config file name if different from default",
19623
19775
  "default": ".gitleaks.toml",
19624
19776
  "category": "REPOSITORY_GITLEAKS",
@@ -19627,7 +19779,7 @@
19627
19779
  "REPOSITORY_GITLEAKS_DISABLE_ERRORS": {
19628
19780
  "name": "REPOSITORY_GITLEAKS_DISABLE_ERRORS",
19629
19781
  "type": "boolean",
19630
- "title": "REPOSITORY_GITLEAKS: Disable errors",
19782
+ "title": "(deprecated) REPOSITORY_GITLEAKS: Disable errors",
19631
19783
  "description": "REPOSITORY_GITLEAKS: If true, REPOSITORY_GITLEAKS doesn't make MegaLinter fail even if errors are found",
19632
19784
  "default": false,
19633
19785
  "category": "REPOSITORY_GITLEAKS",
@@ -19636,7 +19788,7 @@
19636
19788
  "REPOSITORY_GITLEAKS_DISABLE_ERRORS_IF_LESS_THAN": {
19637
19789
  "name": "REPOSITORY_GITLEAKS_DISABLE_ERRORS_IF_LESS_THAN",
19638
19790
  "type": "number",
19639
- "title": "REPOSITORY_GITLEAKS: Maximum number of errors allowed",
19791
+ "title": "(deprecated) REPOSITORY_GITLEAKS: Maximum number of errors allowed",
19640
19792
  "description": "REPOSITORY_GITLEAKS: If the number of errors found is less than this value, REPOSITORY_GITLEAKS doesn't make MegaLinter fail",
19641
19793
  "default": 0,
19642
19794
  "category": "REPOSITORY_GITLEAKS",
@@ -19646,7 +19798,7 @@
19646
19798
  "name": "REPOSITORY_GITLEAKS_POST_COMMANDS",
19647
19799
  "type": "array",
19648
19800
  "title": "REPOSITORY_GITLEAKS: Post-run commands",
19649
- "description": "REPOSITORY_GITLEAKS: Define bash commands to run after running REPOSITORY_GITLEAKS",
19801
+ "description": "(deprecated) REPOSITORY_GITLEAKS: Define bash commands to run after running REPOSITORY_GITLEAKS",
19650
19802
  "examples": [
19651
19803
  [
19652
19804
  {
@@ -19663,7 +19815,7 @@
19663
19815
  "name": "REPOSITORY_GITLEAKS_PRE_COMMANDS",
19664
19816
  "type": "array",
19665
19817
  "title": "REPOSITORY_GITLEAKS: Pre-run commands",
19666
- "description": "REPOSITORY_GITLEAKS: Define bash commands to run before running REPOSITORY_GITLEAKS",
19818
+ "description": "(deprecated) REPOSITORY_GITLEAKS: Define bash commands to run before running REPOSITORY_GITLEAKS",
19667
19819
  "examples": [
19668
19820
  [
19669
19821
  {
@@ -19703,7 +19855,7 @@
19703
19855
  "REPOSITORY_GITLEAKS_RULES_PATH": {
19704
19856
  "name": "REPOSITORY_GITLEAKS_RULES_PATH",
19705
19857
  "type": "string",
19706
- "title": "REPOSITORY_GITLEAKS: Custom config file path",
19858
+ "title": "(deprecated) REPOSITORY_GITLEAKS: Custom config file path",
19707
19859
  "description": "REPOSITORY_GITLEAKS: Path where to find linter configuration file",
19708
19860
  "category": "REPOSITORY_GITLEAKS",
19709
19861
  "section": "LINTER_COMMAND"
@@ -19711,7 +19863,7 @@
19711
19863
  "REPOSITORY_GITLEAKS_UNSECURED_ENV_VARIABLES": {
19712
19864
  "name": "REPOSITORY_GITLEAKS_UNSECURED_ENV_VARIABLES",
19713
19865
  "type": "array",
19714
- "title": "REPOSITORY_GITLEAKS: Unsecured env variables",
19866
+ "title": "(deprecated) REPOSITORY_GITLEAKS: Unsecured env variables",
19715
19867
  "description": "List of env variables explicitly not filtered before calling REPOSITORY_GITLEAKS and its pre/post commands",
19716
19868
  "default": [],
19717
19869
  "category": "REPOSITORY_GITLEAKS",
@@ -24042,6 +24194,7 @@
24042
24194
  "PYTHON_RUFF",
24043
24195
  "PYTHON_RUFF_FORMAT",
24044
24196
  "RAKU_RAKU",
24197
+ "REPOSITORY_BETTERLEAKS",
24045
24198
  "REPOSITORY_CHECKOV",
24046
24199
  "REPOSITORY_DEVSKIM",
24047
24200
  "REPOSITORY_DUSTILOCK",
@@ -25582,7 +25735,7 @@
25582
25735
  "type": "string",
25583
25736
  "title": "SPELL_PROSELINT: Custom config file name",
25584
25737
  "description": "SPELL_PROSELINT: User custom config file name if different from default",
25585
- "default": ".proselintrc",
25738
+ "default": ".proselintrc.json",
25586
25739
  "category": "SPELL_PROSELINT",
25587
25740
  "section": "LINTER_COMMAND"
25588
25741
  },
package/lib/options.js CHANGED
@@ -188,6 +188,12 @@ export const optionsDefinition = optionator.default({
188
188
  description:
189
189
  "Upgrade the local MegaLinter configuration (.mega-linter.yml and related CI files) to the current major version.",
190
190
  },
191
+ {
192
+ option: "prompt",
193
+ type: "Boolean",
194
+ description:
195
+ "Enable interactive prompts. Use --no-prompt to run non-interactively. For `--upgrade`, that proceeds with the upgrade and skips optional follow-up prompts.",
196
+ },
191
197
  {
192
198
  option: "container-name",
193
199
  alias: "containername",
@@ -218,6 +224,18 @@ export const optionsDefinition = optionator.default({
218
224
  description:
219
225
  "Keep the MegaLinter container after the run. Useful for `docker logs <container>` post-mortem.",
220
226
  },
227
+ {
228
+ option: "user-map",
229
+ type: "Boolean",
230
+ description:
231
+ "Run the container as a non-root user. On POSIX systems this uses your user. On other hosts it uses 1000:1000.",
232
+ },
233
+ {
234
+ option: "no-user-map",
235
+ type: "Boolean",
236
+ description:
237
+ "Run the container as root.",
238
+ },
221
239
  {
222
240
  option: "codetotal",
223
241
  type: "Boolean",
package/lib/runner.js CHANGED
@@ -83,7 +83,9 @@ export class MegaLinterRunner {
83
83
 
84
84
  // Run upgrader from v4 to v5
85
85
  if (options.upgrade) {
86
- const megaLinterUpgrader = new MegaLinterUpgrader();
86
+ const megaLinterUpgrader = new MegaLinterUpgrader({
87
+ noPrompt: options.prompt === false,
88
+ });
87
89
  await megaLinterUpgrader.run();
88
90
  return { status: 0 };
89
91
  }
@@ -216,8 +218,16 @@ export class MegaLinterRunner {
216
218
  if (options["containerName"]) {
217
219
  commandArgs.push(...["--name", options["containerName"]]);
218
220
  }
219
- commandArgs.push(...["-v", "/var/run/docker.sock:/var/run/docker.sock:rw"]);
220
221
  commandArgs.push(...["-v", `${lintPath}:/tmp/lint:rw`]);
222
+ if (options["userMap"] === true) {
223
+ const runtimeUid =
224
+ typeof process.getuid === "function" ? process.getuid() : 1000;
225
+ const runtimeGid =
226
+ typeof process.getgid === "function" ? process.getgid() : 1000;
227
+ commandArgs.push(...["-e", `MEGALINTER_UID=${runtimeUid}`]);
228
+ commandArgs.push(...["-e", `MEGALINTER_GID=${runtimeGid}`]);
229
+ commandArgs.push(...["-e", "HOME=/home/megalinter"]);
230
+ }
221
231
  if (emptyEnvFile) {
222
232
  commandArgs.push(...["-v", `${emptyEnvFile}:/tmp/lint/.env:ro`]);
223
233
  }