mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-07 05:21:34 -07:00
Merge pull request #2117 from brother/patch-1
Change error 2076 to a warning.
This commit is contained in:
commit
a69d6cb661
1 changed files with 2 additions and 2 deletions
|
@ -1216,8 +1216,8 @@ checkQuotedCondRegex _ (TC_Binary _ _ "=~" _ rhs) =
|
||||||
where
|
where
|
||||||
error t =
|
error t =
|
||||||
unless (isConstantNonRe t) $
|
unless (isConstantNonRe t) $
|
||||||
err (getId t) 2076
|
warn (getId t) 2076
|
||||||
"Don't quote right-hand side of =~, it'll match literally rather than as a regex."
|
"Remove quotes from right-hand side of =~ to match as a regex rather than literally."
|
||||||
re = mkRegex "[][*.+()|]"
|
re = mkRegex "[][*.+()|]"
|
||||||
hasMetachars s = s `matches` re
|
hasMetachars s = s `matches` re
|
||||||
isConstantNonRe t = fromMaybe False $ do
|
isConstantNonRe t = fromMaybe False $ do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue