mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-26 04:02:18 +08:00
Additionally pluralize 'arguments' in SC2183
This commit is contained in:
@@ -706,8 +706,8 @@ checkPrintfVar = CommandCheck (Exactly "printf") (f . arguments) where
|
|||||||
return () -- Great: a suitable number of arguments
|
return () -- Great: a suitable number of arguments
|
||||||
| otherwise ->
|
| otherwise ->
|
||||||
warn (getId format) 2183 $
|
warn (getId format) 2183 $
|
||||||
"This format string has " ++ show formatCount ++ " " ++ (pluraliseIfMany "variable" formatCount) ++
|
"This format string has " ++ show formatCount ++ " " ++ pluraliseIfMany "variable" formatCount ++
|
||||||
", but is passed " ++ show argCount ++ " arguments."
|
", but is passed " ++ show argCount ++ pluraliseIfMany " argument" argCount ++ "."
|
||||||
|
|
||||||
unless ('%' `elem` concat (oversimplify format) || isLiteral format) $
|
unless ('%' `elem` concat (oversimplify format) || isLiteral format) $
|
||||||
info (getId format) 2059
|
info (getId format) 2059
|
||||||
|
Reference in New Issue
Block a user