mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-06 21:11:35 -07:00
Parse &&/|| as left-associative
This commit is contained in:
parent
363c0633e0
commit
a4042f7523
2 changed files with 2 additions and 2 deletions
|
@ -867,7 +867,7 @@ prop_checkShorthandIf5 = verifyNot checkShorthandIf "foo && rm || printf b"
|
|||
prop_checkShorthandIf6 = verifyNot checkShorthandIf "if foo && bar || baz; then true; fi"
|
||||
prop_checkShorthandIf7 = verifyNot checkShorthandIf "while foo && bar || baz; do true; done"
|
||||
prop_checkShorthandIf8 = verify checkShorthandIf "if true; then foo && bar || baz; fi"
|
||||
checkShorthandIf params x@(T_AndIf id _ (T_OrIf _ _ (T_Pipeline _ _ t)))
|
||||
checkShorthandIf params x@(T_OrIf _ (T_AndIf id _ _) (T_Pipeline _ _ t))
|
||||
| not (isOk t || inCondition) =
|
||||
info id 2015 "Note that A && B || C is not if-then-else. C may run when A is true."
|
||||
where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue