mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-09-30 00:39:19 +08:00
Tighten SC2333/SC2334 to only trigger against literals.
This commit is contained in:
@@ -446,6 +446,12 @@ getLiteralStringExt more = g
|
||||
-- Is this token a string literal?
|
||||
isLiteral t = isJust $ getLiteralString t
|
||||
|
||||
-- Is this token a string literal number?
|
||||
isLiteralNumber t = fromMaybe False $ do
|
||||
s <- getLiteralString t
|
||||
guard $ all isDigit s
|
||||
return True
|
||||
|
||||
-- Escape user data for messages.
|
||||
-- Messages generally avoid repeating user data, but sometimes it's helpful.
|
||||
e4m = escapeForMessage
|
||||
|
Reference in New Issue
Block a user