mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-06 13:01:39 -07:00
Not determine the shell from .sh
extension
See discussion on issue #1369 for details.
This commit is contained in:
parent
1e6a30905a
commit
9f45dc4c8b
2 changed files with 3 additions and 2 deletions
|
@ -51,9 +51,10 @@ tokenToPosition startMap t = fromMaybe fail $ do
|
|||
shellFromFilename filename = foldl mplus Nothing candidates
|
||||
where
|
||||
shellExtensions = [(".ksh", Ksh)
|
||||
,(".sh", Sh)
|
||||
,(".bash", Bash)
|
||||
,(".dash", Dash)]
|
||||
-- The `.sh` is too generic to determine the shell:
|
||||
-- We fallback to Bash in this case and emit SC2148 if there is no shebang
|
||||
candidates =
|
||||
map (\(ext,sh) -> if ext `isSuffixOf` filename then Just sh else Nothing) shellExtensions
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue