Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spell file extensions parameter #2001

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .automation/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,6 @@ def process_type(linters_by_type, type1, type_label, linters_tables_md):
# File extensions & file names override if not "lint_all_files"
if (
linter.lint_all_files is False
and linter.lint_all_other_linters_files is False
):
linter_doc_md += [
# FILE_EXTENSIONS
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l

- New MegaLinter plugin: [mustache](https://github.com/one-acre-fund/mega-linter-plugin-logstash): Plugin to validate [Logstash](https://www.elastic.co/guide/en/logstash/current/configuration.html) pipeline definition files using [mustache](https://github.com/breml/logstash-config), by [Yann Jouanique](https://github.com/Yann-J)

- Add the SPELL_*_FILE_EXTENSIONS parameter for each SPELL type linter. If set, it will use this value to filter instead of the default behavior which is to parse the files of all other linters executed ([#1997](https://github.com/oxsecurity/megalinter/issues/1997)).

- Linter versions upgrades
- [djlint](https://djlint.com/) from 1.19.2 to **1.0.3** on 2022-10-24
- [eslint-plugin-jsonc](https://ota-meshi.github.io/eslint-plugin-jsonc/) from 2.4.0 to **2.5.0** on 2022-10-24
Expand Down
4 changes: 2 additions & 2 deletions megalinter/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ def filter_files(
if filter_regex_exclude_object and filter_regex_exclude_object.search(file):
continue

# Skip according to file extension (only if lint_all_other_linter_files is false)
if lint_all_other_linters_files is False:
# Skip according to file extension (only if lint_all_other_linter_files is false or file_extensions is defined)
if lint_all_other_linters_files is False or len(file_extensions) > 0:
if file_extension in file_extensions:
pass
elif "*" in file_extensions:
Expand Down