From a953dd345463b695ceaae73d2f46d4222ec9d1cc Mon Sep 17 00:00:00 2001 From: Ng Zhi An Date: Sun, 6 May 2018 10:28:17 -0700 Subject: [PATCH] Whitelist rename for SC2016 (fixes #1199) --- src/ShellCheck/Analytics.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ShellCheck/Analytics.hs b/src/ShellCheck/Analytics.hs index ca835b3..207fdc9 100644 --- a/src/ShellCheck/Analytics.hs +++ b/src/ShellCheck/Analytics.hs @@ -788,6 +788,7 @@ prop_checkSingleQuotedVariables11= verifyNot checkSingleQuotedVariables "sed '${ prop_checkSingleQuotedVariables12= verifyNot checkSingleQuotedVariables "eval 'echo $1'" prop_checkSingleQuotedVariables13= verifyNot checkSingleQuotedVariables "busybox awk '{print $1}'" prop_checkSingleQuotedVariables14= verifyNot checkSingleQuotedVariables "[ -v 'bar[$foo]' ]" +prop_checkSingleQuotedVariables15 = verifyNot checkSingleQuotedVariables "rename 's/(.)a/$1/g' *" checkSingleQuotedVariables params t@(T_SingleQuoted id s) = when (s `matches` re) $ if "sed" == commandName @@ -818,6 +819,7 @@ checkSingleQuotedVariables params t@(T_SingleQuoted id s) = ,"docker" -- like above ,"dpkg-query" ,"jq" -- could also check that user provides --arg + ,"rename" ] || "awk" `isSuffixOf` commandName || "perl" `isPrefixOf` commandName