mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-09 14:15:55 +08:00
Not determine the shell from .sh
extension
See discussion on issue #1369 for details.
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user