mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-07 15:55:24 +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
|
||||
isOk [t] = isAssignment t || (fromMaybe False $ do
|
||||
name <- getCommandBasename t
|
||||
return $ name `elem` ["echo", "exit"])
|
||||
return $ name `elem` ["echo", "exit", "return"])
|
||||
isOk _ = False
|
||||
checkShorthandIf _ _ = return ()
|
||||
|
||||
|
Reference in New Issue
Block a user