mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-03-12 12:35:25 -07:00
Merge branch 'read-t-0' of https://github.com/iboss-ptk/shellcheck into iboss-ptk-read-t-0
This commit is contained in:
commit
91abd979f2
@ -2807,8 +2807,11 @@ checkMaskedReturns _ _ = return ()
|
||||
|
||||
prop_checkReadWithoutR1 = verify checkReadWithoutR "read -a foo"
|
||||
prop_checkReadWithoutR2 = verifyNot checkReadWithoutR "read -ar foo"
|
||||
prop_checkReadWithoutR3 = verifyNot checkReadWithoutR "read -t 0"
|
||||
prop_checkReadWithoutR4 = verifyNot checkReadWithoutR "read -t 0 && read --d '' -r bar"
|
||||
prop_checkReadWithoutR5 = verify checkReadWithoutR "read -t 0 foo < file.txt"
|
||||
checkReadWithoutR _ t@T_SimpleCommand {} | t `isUnqualifiedCommand` "read" =
|
||||
unless ("r" `elem` map snd (getAllFlags t)) $
|
||||
unless (oversimplify t == ["read", "-t", "0"] || "r" `elem` map snd (getAllFlags t)) $
|
||||
info (getId $ getCommandTokenOrThis t) 2162 "read without -r will mangle backslashes."
|
||||
checkReadWithoutR _ _ = return ()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user