未验证 提交 8d5e3a80 编写于 作者: V Vidar Holen 提交者: GitHub

Merge pull request #1123 from jonhiggs/check-for-which-usage

Check for calls to `which`.
......@@ -91,6 +91,7 @@ commandChecks = [
,checkMvArguments, checkCpArguments, checkLnArguments
,checkFindRedirections
,checkReadExpansions
,checkWhich
]
buildCommandMap :: [CommandCheck] -> Map.Map CommandName (Token -> Analysis)
......@@ -939,6 +940,9 @@ checkFindRedirections = CommandCheck (Basename "find") f
"Redirection applies to the find command itself. Rewrite to work per action (or move to end)."
_ -> return ()
prop_checkWhich = verify checkWhich "which '.+'"
checkWhich = CommandCheck (Basename "which") $
\t -> info (getId t) 2230 "which is non-standard. Use builtin 'command -v' instead."
return []
runTests = $( [| $(forAllProperties) (quickCheckWithResult (stdArgs { maxSuccess = 1 }) ) |])
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册