Skip to content

Commit b51aac5

Browse files
committed
Ensures custom flavor command uses current version
Updates the custom flavor setup command to include the `@beta` tag or the current ML_VERSION, ensuring users are running the intended version when generating custom flavors. This prevents unexpected behavior or incompatibility issues.
1 parent cfdfb13 commit b51aac5

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

docs/custom-flavors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ You can work directly on **main** branch, or create a sub-branch if you prefer.
2323
Run the following command in your repository folder:
2424

2525
```bash
26-
npx mega-linter-runner --custom-flavor-setup
26+
npx mega-linter-runner@beta --custom-flavor-setup
2727
```
2828

2929
You can also send the list of linters as parameters
3030

3131
```bash
32-
npx mega-linter-runner --custom-flavor-setup --custom-flavor-linters "PYTHON_BANDIT,PYTHON_BLACK,PYTHON_RUFF,REPOSITORY_TRIVY"
32+
npx mega-linter-runner@beta --custom-flavor-setup --custom-flavor-linters "PYTHON_BANDIT,PYTHON_BLACK,PYTHON_RUFF,REPOSITORY_TRIVY"
3333
```
3434

3535
### Follow the interactive prompts

megalinter/reporters/ConsoleReporter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import terminaltables
88
from megalinter import Reporter, config
9-
from megalinter.constants import DEFAULT_RELEASE, ML_DOC_URL, ML_REPO, ML_REPO_URL
9+
from megalinter.constants import DEFAULT_RELEASE, ML_DOC_URL, ML_REPO, ML_REPO_URL, ML_VERSION
1010
from megalinter.utils import blue
1111
from megalinter.utils_reporter import log_section_end
1212

@@ -121,7 +121,7 @@ def produce_report(self):
121121
if self.master.flavor_suggestions is not None:
122122
active_linter_names = [linter.name for linter in self.master.active_linters]
123123
custom_flavor_command = (
124-
"npx mega-linter-runner --custom-flavor-setup --custom-flavor-linters "
124+
f"npx mega-linter-runner@{ML_VERSION} --custom-flavor-setup --custom-flavor-linters "
125125
+ ",".join(active_linter_names)
126126
)
127127
custom_flavor_message = (

megalinter/utils_reporter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
ML_DOC_URL,
1212
ML_DOC_URL_DESCRIPTORS_ROOT,
1313
ML_REPO,
14+
ML_VERSION,
1415
OX_MARKDOWN_LINK,
1516
)
1617
from pytablewriter import Align, MarkdownTableWriter
@@ -190,7 +191,7 @@ def build_markdown_summary_footer(reporter_self, action_run_url=""):
190191
linter.name for linter in reporter_self.master.active_linters
191192
]
192193
custom_flavor_command = (
193-
"npx mega-linter-runner --custom-flavor-setup --custom-flavor-linters "
194+
f"npx mega-linter-runner@{ML_VERSION} --custom-flavor-setup --custom-flavor-linters "
194195
+ ",".join(active_linter_names)
195196
)
196197
custom_flavor_message = (

0 commit comments

Comments
 (0)