From 6ed60b403f41020779851e7060177dadd4556556 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Thu, 21 Dec 2017 03:14:25 +0000 Subject: [PATCH] Extend SC2216/SC2217 with 'true' and 'false' --- ShellCheck/Analytics.hs | 1 + ShellCheck/Data.hs | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ShellCheck/Analytics.hs b/ShellCheck/Analytics.hs index 6863417..c250b28 100644 --- a/ShellCheck/Analytics.hs +++ b/ShellCheck/Analytics.hs @@ -2819,6 +2819,7 @@ prop_checkPipeToNowhere4 = verify checkPipeToNowhere "printf 'Lol' << eof\nlol\n prop_checkPipeToNowhere5 = verifyNot checkPipeToNowhere "echo foo | xargs du" prop_checkPipeToNowhere6 = verifyNot checkPipeToNowhere "ls | echo $(cat)" prop_checkPipeToNowhere7 = verifyNot checkPipeToNowhere "echo foo | var=$(cat) ls" +prop_checkPipeToNowhere8 = verify checkPipeToNowhere "foo | true" checkPipeToNowhere :: Parameters -> Token -> WriterT [TokenComment] Identity () checkPipeToNowhere _ t = case t of diff --git a/ShellCheck/Data.hs b/ShellCheck/Data.hs index a575768..7875700 100644 --- a/ShellCheck/Data.hs +++ b/ShellCheck/Data.hs @@ -79,10 +79,10 @@ commonCommands = [ nonReadingCommands = [ "alias", "basename", "bg", "cal", "cd", "chgrp", "chmod", "chown", - "cp", "du", "echo", "export", "fg", "fuser", "getconf", "getopt", - "getopts", "ipcrm", "ipcs", "jobs", "kill", "ln", "ls", "locale", "mv", - "nice", "printf", "ps", "pwd", "renice", "rm", "rmdir", "set", "sleep", - "touch", "trap", "ulimit", "unalias", "uname" + "cp", "du", "echo", "export", "false", "fg", "fuser", "getconf", + "getopt", "getopts", "ipcrm", "ipcs", "jobs", "kill", "ln", "ls", + "locale", "mv", "nice", "printf", "ps", "pwd", "renice", "rm", "rmdir", + "set", "sleep", "touch", "trap", "true", "ulimit", "unalias", "uname" ] sampleWords = [ -- GitLab