mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-06 13:01:39 -07:00
Remove unnecessary fromMaybes
This commit is contained in:
parent
8e9290badb
commit
a223a7a5a5
2 changed files with 3 additions and 4 deletions
|
@ -2823,11 +2823,10 @@ checkReadWithoutR _ t@T_SimpleCommand {} | t `isUnqualifiedCommand` "read"
|
||||||
info (getId $ getCommandTokenOrThis t) 2162 "read without -r will mangle backslashes."
|
info (getId $ getCommandTokenOrThis t) 2162 "read without -r will mangle backslashes."
|
||||||
where
|
where
|
||||||
flags = getAllFlags t
|
flags = getAllFlags t
|
||||||
has_t0 = fromMaybe False $ do
|
has_t0 = Just "0" == do
|
||||||
parsed <- getOpts flagsForRead flags
|
parsed <- getOpts flagsForRead flags
|
||||||
t <- lookup "t" parsed
|
t <- lookup "t" parsed
|
||||||
str <- getLiteralString t
|
getLiteralString t
|
||||||
return $ str == "0"
|
|
||||||
|
|
||||||
checkReadWithoutR _ _ = return ()
|
checkReadWithoutR _ _ = return ()
|
||||||
|
|
||||||
|
|
|
@ -454,7 +454,7 @@ leadType params t =
|
||||||
T_BatsTest {} -> SubshellScope "@bats test"
|
T_BatsTest {} -> SubshellScope "@bats test"
|
||||||
T_CoProcBody _ _ -> SubshellScope "coproc"
|
T_CoProcBody _ _ -> SubshellScope "coproc"
|
||||||
T_Redirecting {} ->
|
T_Redirecting {} ->
|
||||||
if fromMaybe False causesSubshell
|
if causesSubshell == Just True
|
||||||
then SubshellScope "pipeline"
|
then SubshellScope "pipeline"
|
||||||
else NoneScope
|
else NoneScope
|
||||||
_ -> NoneScope
|
_ -> NoneScope
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue