diff --git a/src/ShellCheck/AnalyzerLib.hs b/src/ShellCheck/AnalyzerLib.hs index da528a4..71defa0 100644 --- a/src/ShellCheck/AnalyzerLib.hs +++ b/src/ShellCheck/AnalyzerLib.hs @@ -224,9 +224,9 @@ makeParameters spec = params hasPipefail = case shellType params of Bash -> isOptionSet "pipefail" root - Dash -> True + Dash -> isOptionSet "pipefail" root BusyboxSh -> isOptionSet "pipefail" root - Sh -> True + Sh -> isOptionSet "pipefail" root Ksh -> isOptionSet "pipefail" root, hasExecfail = case shellType params of diff --git a/src/ShellCheck/Checks/ShellSupport.hs b/src/ShellCheck/Checks/ShellSupport.hs index b664879..4ce4fa8 100644 --- a/src/ShellCheck/Checks/ShellSupport.hs +++ b/src/ShellCheck/Checks/ShellSupport.hs @@ -175,7 +175,7 @@ prop_checkBashisms80 = verifyNot checkBashisms "#!/bin/sh\nhash -r" prop_checkBashisms81 = verifyNot checkBashisms "#!/bin/dash\nhash -v" prop_checkBashisms82 = verifyNot checkBashisms "#!/bin/sh\nset -v +o allexport -o errexit -C" prop_checkBashisms83 = verifyNot checkBashisms "#!/bin/sh\nset --" -prop_checkBashisms84 = verify checkBashisms "#!/bin/sh\nset -o pipefail" +prop_checkBashisms84 = verifyNot checkBashisms "#!/bin/sh\nset -o pipefail" prop_checkBashisms85 = verify checkBashisms "#!/bin/sh\nset -B" prop_checkBashisms86 = verifyNot checkBashisms "#!/bin/dash\nset -o emacs" prop_checkBashisms87 = verify checkBashisms "#!/bin/sh\nset -o emacs" @@ -383,8 +383,8 @@ checkBashisms = ForShell [Sh, Dash, BusyboxSh] $ \t -> do beginsWithDoubleDash = (`matches` mkRegex "^--.+$") longOptions = Set.fromList [ "allexport", "errexit", "ignoreeof", "monitor", "noclobber" - , "noexec", "noglob", "nolog", "notify" , "nounset", "verbose" - , "vi", "xtrace" ] + , "noexec", "noglob", "nolog", "notify" , "nounset", "pipefail" + , "verbose", "vi", "xtrace" ] bashism t@(T_SimpleCommand id _ (cmd:rest)) = let name = fromMaybe "" $ getCommandName t