Make ShellCheck not emit warnings about the shebang if the shell

type is determined from the extension
This commit is contained in:
Tito Sacchi 2019-01-14 14:25:01 +01:00
parent a4b9cec9f0
commit 1e6a30905a
2 changed files with 2 additions and 2 deletions

View File

@ -484,7 +484,7 @@ checkShebang params (T_Annotation _ list t) =
checkShebang params (T_Script id sb _) = execWriter $ do
unless (shellTypeSpecified params) $ do
when (sb == "") $
err id 2148 "Tips depend on target shell and yours is unknown. Add a shebang."
err id 2148 "Tips depend on target shell and yours is unknown. Add a shebang or an extension to the filename."
when (executableFromShebang sb == "ash") $
warn id 2187 "Ash scripts will be checked as Dash. Add '# shellcheck shell=dash' to silence."
unless (null sb) $ do

View File

@ -184,7 +184,7 @@ makeParameters spec =
Sh -> False
Ksh -> True,
shellTypeSpecified = isJust $ asShellType spec,
shellTypeSpecified = isJust (asShellType spec) || isJust (asFallbackShell spec),
parentMap = getParentTree root,
variableFlow = getVariableFlow params root,
tokenPositions = asTokenPositions spec