mirror of
https://github.com/koalaman/shellcheck
synced 2025-08-19 13:00:54 -07:00
Tweaked some messages and added more badcases
This commit is contained in:
parent
279e972b61
commit
67d27ea42d
22 changed files with 60 additions and 16 deletions
|
@ -67,7 +67,7 @@ checkBasic f s = case parseShell "-" s of
|
|||
|
||||
prop_checkUuoc = verify checkUuoc "cat foo | grep bar"
|
||||
checkUuoc (T_Pipeline _ (T_Redirecting _ _ f@(T_SimpleCommand id _ _):_:_)) =
|
||||
case deadSimple f of ["cat", _] -> addNoteFor id $ Note InfoC "UUOC: 'cat foo | bar | baz' is better written as 'bar < foo | baz'"
|
||||
case deadSimple f of ["cat", _] -> addNoteFor id $ Note StyleC "Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead."
|
||||
_ -> return ()
|
||||
checkUuoc _ = return ()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue