From ab20747ef220040b3fd0bd2300ccb335ad6ea399 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Thu, 4 Jul 2013 12:01:34 -0700 Subject: [PATCH] Removed warning for ~ in the middle of strings. Too common. --- ShellCheck/Analytics.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ShellCheck/Analytics.hs b/ShellCheck/Analytics.hs index 6c8cd5e..ef2f714 100644 --- a/ShellCheck/Analytics.hs +++ b/ShellCheck/Analytics.hs @@ -1108,16 +1108,13 @@ checkInexplicablyUnquoted _ = return () prop_checkTildeInQuotes1 = verify checkTildeInQuotes "var=\"~/out.txt\"" prop_checkTildeInQuotes2 = verify checkTildeInQuotes "foo > '~/dir'" -prop_checkTildeInQuotes3 = verify checkTildeInQuotes "args='-s ~/dir'" prop_checkTildeInQuotes4 = verifyNot checkTildeInQuotes "~/file" prop_checkTildeInQuotes5 = verifyNot checkTildeInQuotes "echo '/~foo/cow'" +prop_checkTildeInQuotes6 = verifyNot checkTildeInQuotes "awk '$0 ~ /foo/'" checkTildeInQuotes = check where - post f = f "Note that ~ does not expand in quotes" - verify id ('~':_) = post (warn id) - verify id str = - when (isJust $ matchRegex re str) $ post (info id) - re = mkRegex "\\s~" + verify id ('~':_) = warn id "Note that ~ does not expand in quotes." + verify _ _ = return () check (T_NormalWord _ ((T_SingleQuoted id str):_)) = verify id str check (T_NormalWord _ ((T_DoubleQuoted _ ((T_Literal id str):_)):_)) =