mirror of
https://github.com/koalaman/shellcheck
synced 2025-08-22 06:13:54 -07:00
Merge f5cd37405b
into 3a944de606
This commit is contained in:
commit
b33b439874
1 changed files with 2 additions and 1 deletions
|
@ -490,7 +490,7 @@ prop_checkPipePitfalls6 = verify checkPipePitfalls "find . | xargs foo"
|
|||
checkPipePitfalls _ (T_Pipeline id _ commands) = do
|
||||
for ["find", "xargs"] $
|
||||
\(find:xargs:_) -> let args = deadSimple xargs in
|
||||
unless (hasShortParameter args '0') $
|
||||
unless (hasShortParameter args '0' || hasLongParameter args "--null") $
|
||||
warn (getId find) 2038 "Use either 'find .. -print0 | xargs -0 ..' or 'find .. -exec .. +' to allow for non-alphanumeric filenames."
|
||||
|
||||
for ["?", "echo"] $
|
||||
|
@ -523,6 +523,7 @@ checkPipePitfalls _ (T_Pipeline id _ commands) = do
|
|||
first func (x:_) = func (getId x)
|
||||
first _ _ = return ()
|
||||
hasShortParameter list char = any (\x -> "-" `isPrefixOf` x && char `elem` x) list
|
||||
hasLongParameter list string = elem string list
|
||||
checkPipePitfalls _ _ = return ()
|
||||
|
||||
indexOfSublists sub = f 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue