Whitelist rename for SC2016 (fixes #1199)

This commit is contained in:
Ng Zhi An 2018-05-06 10:28:17 -07:00
parent ef6a5b97b9
commit a953dd3454
1 changed files with 2 additions and 0 deletions

View File

@ -788,6 +788,7 @@ prop_checkSingleQuotedVariables11= verifyNot checkSingleQuotedVariables "sed '${
prop_checkSingleQuotedVariables12= verifyNot checkSingleQuotedVariables "eval 'echo $1'" prop_checkSingleQuotedVariables12= verifyNot checkSingleQuotedVariables "eval 'echo $1'"
prop_checkSingleQuotedVariables13= verifyNot checkSingleQuotedVariables "busybox awk '{print $1}'" prop_checkSingleQuotedVariables13= verifyNot checkSingleQuotedVariables "busybox awk '{print $1}'"
prop_checkSingleQuotedVariables14= verifyNot checkSingleQuotedVariables "[ -v 'bar[$foo]' ]" prop_checkSingleQuotedVariables14= verifyNot checkSingleQuotedVariables "[ -v 'bar[$foo]' ]"
prop_checkSingleQuotedVariables15 = verifyNot checkSingleQuotedVariables "rename 's/(.)a/$1/g' *"
checkSingleQuotedVariables params t@(T_SingleQuoted id s) = checkSingleQuotedVariables params t@(T_SingleQuoted id s) =
when (s `matches` re) $ when (s `matches` re) $
if "sed" == commandName if "sed" == commandName
@ -818,6 +819,7 @@ checkSingleQuotedVariables params t@(T_SingleQuoted id s) =
,"docker" -- like above ,"docker" -- like above
,"dpkg-query" ,"dpkg-query"
,"jq" -- could also check that user provides --arg ,"jq" -- could also check that user provides --arg
,"rename"
] ]
|| "awk" `isSuffixOf` commandName || "awk" `isSuffixOf` commandName
|| "perl" `isPrefixOf` commandName || "perl" `isPrefixOf` commandName