Skip to content

Commit

Permalink
feat: support shell scripts with no extension, fix perl shebang regex (
Browse files Browse the repository at this point in the history
  • Loading branch information
tnyeanderson authored Oct 8, 2024
1 parent 9bb1494 commit eae4747
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
- Embed vulnerability database in Docker Image for running trivy on internet-free network
- Retry 5 times after 3 seconds in case of TooManyRequests when downloading vulnerability database
- If the retries did not succeed, call trivy with `--skip-db-update --skip-check-update` (not ideal but better than nothing)
- Bash/Perl: Support shell scripts with no extension and only support perl shebangs at the beginning of a file in <https://github.com/oxsecurity/megalinter/pull/4076>

- Fixes
- Add debug traces to investigate reporters activation
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 @@ -82,6 +82,7 @@ This linter is available in the following flavors
### How are identified applicable files

- File extensions: `.sh`, `.bash`, `.dash`, `.ksh`
- Shebangs: `#!/usr/bin/env bash`, `#!/bin/bash`, `#!/bin/sh`

<!-- markdownlint-disable -->
<!-- /* cSpell:disable */ -->
Expand Down
7 changes: 7 additions & 0 deletions megalinter/descriptors/bash.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ descriptor_flavors:
- c_cpp
- formatters
file_extensions:
- ""
- ".sh"
- ".bash"
- ".dash"
- ".ksh"
file_contains_regex_extensions:
- ""
file_contains_regex:
- "^#!/usr/bin/env bash"
- "^#!/bin/bash"
- "^#!/bin/sh"
install:
apk:
- bash
Expand Down
4 changes: 2 additions & 2 deletions megalinter/descriptors/perl.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ file_extensions:
file_contains_regex_extensions:
- ""
file_contains_regex:
- "#!/usr/bin/env perl"
- "#!/usr/bin/perl"
- "^#!/usr/bin/env perl"
- "^#!/usr/bin/perl"
install:
apk:
- perl
Expand Down

0 comments on commit eae4747

Please sign in to comment.