Improved error messages for SC2044/SC2045
This commit is contained in:
parent
558d8ffc6c
commit
f9aeabc245
|
@ -701,8 +701,8 @@ checkForInLs _ t = try t
|
||||||
case deadSimple x of
|
case deadSimple x of
|
||||||
("ls":n) ->
|
("ls":n) ->
|
||||||
let warntype = if any ("-" `isPrefixOf`) n then warn else err in
|
let warntype = if any ("-" `isPrefixOf`) n then warn else err in
|
||||||
warntype id 2045 $ "Iterate over globs whenever possible (e.g. 'for f in */*.wav'), as for loops over ls will fail for filenames like 'my file*.txt'."
|
warntype id 2045 "Iterating over ls output is fragile. Use globs."
|
||||||
("find":_) -> warn id 2044 $ "Use find -exec or a while read loop instead, as for loops over find will fail for filenames like 'my file*.txt'."
|
("find":_) -> warn id 2044 "For loops over find output are fragile. Use find -exec or a while read loop."
|
||||||
_ -> return ()
|
_ -> return ()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue