mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 14:10:38 +08:00
Remove unnecessary fromMaybes
This commit is contained in:
@@ -2823,11 +2823,10 @@ checkReadWithoutR _ t@T_SimpleCommand {} | t `isUnqualifiedCommand` "read"
|
||||
info (getId $ getCommandTokenOrThis t) 2162 "read without -r will mangle backslashes."
|
||||
where
|
||||
flags = getAllFlags t
|
||||
has_t0 = fromMaybe False $ do
|
||||
has_t0 = Just "0" == do
|
||||
parsed <- getOpts flagsForRead flags
|
||||
t <- lookup "t" parsed
|
||||
str <- getLiteralString t
|
||||
return $ str == "0"
|
||||
getLiteralString t
|
||||
|
||||
checkReadWithoutR _ _ = return ()
|
||||
|
||||
|
@@ -454,7 +454,7 @@ leadType params t =
|
||||
T_BatsTest {} -> SubshellScope "@bats test"
|
||||
T_CoProcBody _ _ -> SubshellScope "coproc"
|
||||
T_Redirecting {} ->
|
||||
if fromMaybe False causesSubshell
|
||||
if causesSubshell == Just True
|
||||
then SubshellScope "pipeline"
|
||||
else NoneScope
|
||||
_ -> NoneScope
|
||||
|
Reference in New Issue
Block a user