shell-linter icon indicating copy to clipboard operation
shell-linter copied to clipboard

scan_regex too restrictive?

Open kaihowl opened this issue 3 years ago • 2 comments

New Issue Checklist

  • [x] Using the latest version of azohra/shell-linter
  • [x] Able to reproduce error multiple times
  • [x] Provided information about the bug
  • [x] Attached additional information about the error including logs

Issue Description

The `scan-regex` with `#!.*[/ ](sh|bash|dash|ksh)$` does not expect valid options in shebang.

Steps to Reproduce

Add a repo with a bash file "test.sh" that start with `#!/bin/bash -e`.

Error Message

ShellCheck only supports sh/bash/dash/ksh scripts. For supported scripts to be scanned, make sure to add a proper shebang on the first line of the script.

Logs

n/a

Link to the GitHub Actions workflow (optional)

n/a

kaihowl avatar Dec 04 '21 22:12 kaihowl

Hi,

shellcheck also supports forcing zsh scripts for example to be interpreted as if they are bash script by adding the following after the shebang:

# shellcheck shell=bash

Is that also something that should be supported? Or is it already and I overlooked something in the configuration?

kaihowl avatar Dec 05 '21 08:12 kaihowl