Add ":" alongside "true" for SC2015

This commit is contained in:
Vidar Holen 2025-04-11 19:14:53 -07:00
parent de07ec1c56
commit f78714e0f6

View file

@ -890,7 +890,7 @@ checkShorthandIf params x@(T_OrIf _ (T_AndIf id _ b) (T_Pipeline _ _ t))
where
isOk [t] = isAssignment t || fromMaybe False (do
name <- getCommandBasename t
return $ name `elem` ["echo", "exit", "return", "printf", "true"])
return $ name `elem` ["echo", "exit", "return", "printf", "true", ":"])
isOk _ = False
inCondition = isCondition $ getPath (parentMap params) x
checkShorthandIf _ _ = return ()