From f9aeabc2453d23d4839229eb9fbebedcdad94332 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Thu, 8 May 2014 19:38:40 -0700 Subject: [PATCH] Improved error messages for SC2044/SC2045 --- ShellCheck/Analytics.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShellCheck/Analytics.hs b/ShellCheck/Analytics.hs index 67f6a6c..5dafe56 100644 --- a/ShellCheck/Analytics.hs +++ b/ShellCheck/Analytics.hs @@ -701,8 +701,8 @@ checkForInLs _ t = try t case deadSimple x of ("ls":n) -> let warntype = if any ("-" `isPrefixOf`) n then warn else err in - warntype id 2045 $ "Iterate over globs whenever possible (e.g. 'for f in */*.wav'), as for loops over ls will fail for filenames like 'my file*.txt'." - ("find":_) -> warn id 2044 $ "Use find -exec or a while read loop instead, as for loops over find will fail for filenames like 'my file*.txt'." + warntype id 2045 "Iterating over ls output is fragile. Use globs." + ("find":_) -> warn id 2044 "For loops over find output are fragile. Use find -exec or a while read loop." _ -> return ()