mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-07 01:59:27 +08:00
s/range/class/ when warning about tr '[abc]'
This commit is contained in:
@@ -150,7 +150,7 @@ checkTr = CommandCheck (Basename "tr") (mapM_ f . arguments)
|
||||
info (getId word) 2020 "tr replaces sets of chars, not words (mentioned due to duplicates)."
|
||||
unless ("[:" `isPrefixOf` s) $
|
||||
when ("[" `isPrefixOf` s && "]" `isSuffixOf` s && (length s > 2) && ('*' `notElem` s)) $
|
||||
info (getId word) 2021 "Don't use [] around ranges in tr, it replaces literal square brackets."
|
||||
info (getId word) 2021 "Don't use [] around classes in tr, it replaces literal square brackets."
|
||||
Nothing -> return ()
|
||||
|
||||
duplicated s =
|
||||
|
Reference in New Issue
Block a user