diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0c31dc82548..3ec4df17c89 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,7 @@ 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
+- Document the `-f` argument to mega-linter-runner ([#1895](https://github.com/oxsecurity/megalinter/issues/1895))
- Fix a typo in documentation of bash-exec linter ([#1892](https://github.com/oxsecurity/megalinter/pull/1892))
- Add quotes to arm-ttk linter command ([#1879](https://github.com/oxsecurity/megalinter/issues/1879))
diff --git a/mega-linter-runner/README.md b/mega-linter-runner/README.md
index cdc6000e427..bbc378d2a6b 100644
--- a/mega-linter-runner/README.md
+++ b/mega-linter-runner/README.md
@@ -97,7 +97,7 @@ The options are only related to mega-linter-runner. For MegaLinter options, plea
| Option | Description | Default |
|------------------------|--------------------------------------------------------------------------------------------------------------------|-------------------|
| `-p`
`--path` | Directory containing the files to lint | current directory |
-| `--flavor` | Set this parameter to use a [MegaLinter flavor](https://megalinter.github.io/flavors/) | `all` |
+| `-f`
`--flavor` | Set this parameter to use a [MegaLinter flavor](https://megalinter.github.io/flavors/) | `all` |
| `-d`
`--image` | You can override the used docker image, including if it is on another docker registry | |
| `-e`
`--env` | Environment variables for MegaLinter, following format **'ENV_VAR_NAME=VALUE'**
Warning: Quotes are mandatory | |
| `--fix` | Automatically apply formatting and fixes in your files | |
diff --git a/megalinter/MegaLinter.py b/megalinter/MegaLinter.py
index 2019a70b7db..fe0e51e5a7e 100644
--- a/megalinter/MegaLinter.py
+++ b/megalinter/MegaLinter.py
@@ -563,12 +563,13 @@ def collect_files(self):
logging.debug(
"All found files before filtering:" + utils.format_bullet_list(all_files)
)
- # Filter files according to fileExtensions, fileNames , filterRegexInclude and filterRegexExclude
- if len(self.file_extensions) > 0:
+ # Filter files according to file_extensions, file_names_regex,
+ # filter_regex_include, and filter_regex_exclude
+ if self.file_extensions:
logging.info(
"- File extensions: " + ", ".join(sorted(self.file_extensions))
)
- if len(self.file_names_regex) > 0:
+ if self.file_names_regex:
logging.info(
"- File names (regex): " + ", ".join(sorted(self.file_names_regex))
)
diff --git a/megalinter/utils.py b/megalinter/utils.py
index ed820760626..e67e5c873c1 100644
--- a/megalinter/utils.py
+++ b/megalinter/utils.py
@@ -74,7 +74,7 @@ def filter_files(
lint_all_other_linters_files: bool = False,
prefix: Optional[str] = None,
) -> Sequence[str]:
- file_extensions = set(file_extensions)
+ file_extensions = frozenset(file_extensions)
filter_regex_include_object = (
re.compile(filter_regex_include) if filter_regex_include else None
)
@@ -92,7 +92,7 @@ def filter_files(
# if each file is check against every ignored_files (it can contain all the files), it's a O(n²) filtering
# to reduce the execution time and complexity ignored_files is split
ignored_patterns = list(filter(lambda x: "*" in x, ignored_files or []))
- ignored_fileset = set(ignored_files or [])
+ ignored_fileset = frozenset(ignored_files or [])
# Filter all files to keep only the ones matching with the current linter