From 218deb6d01ec327fdf91d8d3a00f1ecccfc9df44 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Tue, 8 Sep 2020 19:30:13 -0700 Subject: [PATCH] Update SC2091/SC2092 message and ignore in quotes. --- src/ShellCheck/Analytics.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ShellCheck/Analytics.hs b/src/ShellCheck/Analytics.hs index e0d33bb..c39f8c8 100644 --- a/src/ShellCheck/Analytics.hs +++ b/src/ShellCheck/Analytics.hs @@ -1692,19 +1692,17 @@ checkSpuriousExec _ = doLists prop_checkSpuriousExpansion1 = verify checkSpuriousExpansion "if $(true); then true; fi" -prop_checkSpuriousExpansion2 = verify checkSpuriousExpansion "while \"$(cmd)\"; do :; done" prop_checkSpuriousExpansion3 = verifyNot checkSpuriousExpansion "$(cmd) --flag1 --flag2" prop_checkSpuriousExpansion4 = verify checkSpuriousExpansion "$((i++))" checkSpuriousExpansion _ (T_SimpleCommand _ _ [T_NormalWord _ [word]]) = check word where check word = case word of T_DollarExpansion id _ -> - warn id 2091 "Remove surrounding $() to avoid executing output." + warn id 2091 "Remove surrounding $() to avoid executing output (or use eval if intentional)." T_Backticked id _ -> - warn id 2092 "Remove backticks to avoid executing output." + warn id 2092 "Remove backticks to avoid executing output (or use eval if intentional)." T_DollarArithmetic id _ -> err id 2084 "Remove '$' or use '_=$((expr))' to avoid executing output." - T_DoubleQuoted id [subword] -> check subword _ -> return () checkSpuriousExpansion _ _ = return ()