Removed warning for ~ in the middle of strings. Too common.
This commit is contained in:
parent
9e84ff66f7
commit
ab20747ef2
|
@ -1108,16 +1108,13 @@ checkInexplicablyUnquoted _ = return ()
|
||||||
|
|
||||||
prop_checkTildeInQuotes1 = verify checkTildeInQuotes "var=\"~/out.txt\""
|
prop_checkTildeInQuotes1 = verify checkTildeInQuotes "var=\"~/out.txt\""
|
||||||
prop_checkTildeInQuotes2 = verify checkTildeInQuotes "foo > '~/dir'"
|
prop_checkTildeInQuotes2 = verify checkTildeInQuotes "foo > '~/dir'"
|
||||||
prop_checkTildeInQuotes3 = verify checkTildeInQuotes "args='-s ~/dir'"
|
|
||||||
prop_checkTildeInQuotes4 = verifyNot checkTildeInQuotes "~/file"
|
prop_checkTildeInQuotes4 = verifyNot checkTildeInQuotes "~/file"
|
||||||
prop_checkTildeInQuotes5 = verifyNot checkTildeInQuotes "echo '/~foo/cow'"
|
prop_checkTildeInQuotes5 = verifyNot checkTildeInQuotes "echo '/~foo/cow'"
|
||||||
|
prop_checkTildeInQuotes6 = verifyNot checkTildeInQuotes "awk '$0 ~ /foo/'"
|
||||||
checkTildeInQuotes = check
|
checkTildeInQuotes = check
|
||||||
where
|
where
|
||||||
post f = f "Note that ~ does not expand in quotes"
|
verify id ('~':_) = warn id "Note that ~ does not expand in quotes."
|
||||||
verify id ('~':_) = post (warn id)
|
verify _ _ = return ()
|
||||||
verify id str =
|
|
||||||
when (isJust $ matchRegex re str) $ post (info id)
|
|
||||||
re = mkRegex "\\s~"
|
|
||||||
check (T_NormalWord _ ((T_SingleQuoted id str):_)) =
|
check (T_NormalWord _ ((T_SingleQuoted id str):_)) =
|
||||||
verify id str
|
verify id str
|
||||||
check (T_NormalWord _ ((T_DoubleQuoted _ ((T_Literal id str):_)):_)) =
|
check (T_NormalWord _ ((T_DoubleQuoted _ ((T_Literal id str):_)):_)) =
|
||||||
|
|
Loading…
Reference in New Issue