mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-26 02:41:39 +08:00
Add ":" alongside "true" for SC2015
This commit is contained in:
@@ -890,7 +890,7 @@ checkShorthandIf params x@(T_OrIf _ (T_AndIf id _ b) (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", "printf", "true"])
|
return $ name `elem` ["echo", "exit", "return", "printf", "true", ":"])
|
||||||
isOk _ = False
|
isOk _ = False
|
||||||
inCondition = isCondition $ getPath (parentMap params) x
|
inCondition = isCondition $ getPath (parentMap params) x
|
||||||
checkShorthandIf _ _ = return ()
|
checkShorthandIf _ _ = return ()
|
||||||
|
Reference in New Issue
Block a user