From 3a9ae0ebf1c008a5710f4286db2d7b4f96b3357a Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Sun, 3 Nov 2013 12:42:11 -0800 Subject: [PATCH] Accept dir-/basename due to edge cases like "/" and "foo" --- ShellCheck/Analytics.hs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ShellCheck/Analytics.hs b/ShellCheck/Analytics.hs index 617420a..56d1b43 100644 --- a/ShellCheck/Analytics.hs +++ b/ShellCheck/Analytics.hs @@ -314,10 +314,6 @@ prop_checkNeedlessCommands = verify checkNeedlessCommands "foo=$(expr 3 + 2)" prop_checkNeedlessCommands2 = verify checkNeedlessCommands "foo=`echo \\`expr 3 + 2\\``" checkNeedlessCommands (T_SimpleCommand id _ (w:_)) | w `isCommand` "expr" = style id "expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]]." -checkNeedlessCommands (T_SimpleCommand id _ (w:_)) | w `isCommand` "dirname" = - style id "Use parameter expansion instead, such as ${var%/*}." -checkNeedlessCommands (T_SimpleCommand id _ (w:_)) | w `isCommand` "basename" = - style id "Use parameter expansion instead, such as ${var##*/}." checkNeedlessCommands _ = return () prop_checkPipePitfalls3 = verify checkPipePitfalls "ls | grep -v mp3"