Tighten SC2333/SC2334 to only trigger against literals.

This commit is contained in:
Vidar Holen
2025-05-17 00:55:50 +00:00
parent ad58768563
commit 47d358c1d4
2 changed files with 25 additions and 10 deletions

View File

@@ -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