mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-09-18 17:56:55 +08:00
Don't warn about &&+|| when used with return
This commit is contained in:
@@ -814,7 +814,7 @@ checkShorthandIf _ (T_AndIf id _ (T_OrIf _ _ (T_Pipeline _ _ t)))
|
|||||||
where
|
where
|
||||||
isOk [t] = isAssignment t || (fromMaybe False $ do
|
isOk [t] = isAssignment t || (fromMaybe False $ do
|
||||||
name <- getCommandBasename t
|
name <- getCommandBasename t
|
||||||
return $ name `elem` ["echo", "exit"])
|
return $ name `elem` ["echo", "exit", "return"])
|
||||||
isOk _ = False
|
isOk _ = False
|
||||||
checkShorthandIf _ _ = return ()
|
checkShorthandIf _ _ = return ()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user