mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-03-12 12:35:25 -07:00
Change error 2076 to a warning.
Implementing the suggestion by @pixarbuff #1985.
This commit is contained in:
parent
bd3299edd3
commit
19355226e1
@ -1193,8 +1193,8 @@ checkQuotedCondRegex _ (TC_Binary _ _ "=~" _ rhs) =
|
||||
where
|
||||
error t =
|
||||
unless (isConstantNonRe t) $
|
||||
err (getId t) 2076
|
||||
"Don't quote right-hand side of =~, it'll match literally rather than as a regex."
|
||||
warn (getId t) 2076
|
||||
"Remove quotes from right-hand side of =~ to match as a regex rather than literally."
|
||||
re = mkRegex "[][*.+()|]"
|
||||
hasMetachars s = s `matches` re
|
||||
isConstantNonRe t = fromMaybe False $ do
|
||||
|
Loading…
x
Reference in New Issue
Block a user