From e6af95713183f7586b7c1e293ace68613f688324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Verg=C3=A9?= Date: Fri, 8 Jul 2022 16:26:33 +0200 Subject: [PATCH] float-values: Add missing quotes in problems messages To be consistent with other existing messages, e.g.: - forbidden not a number value ".NaN" - found forbidden document start "---" - missing document start "---" - truthy value should be one of ["true"] - forbidden implicit octal value "0777" --- yamllint/rules/float_values.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yamllint/rules/float_values.py b/yamllint/rules/float_values.py index 6a80bb9d..d8c46908 100644 --- a/yamllint/rules/float_values.py +++ b/yamllint/rules/float_values.py @@ -129,14 +129,14 @@ def check(conf, token, prev, next, nextnext, context): yield LintProblem( token.start_mark.line + 1, token.start_mark.column + 1, - 'forbidden not a number value "%s"' % token.value, + f'forbidden not a number value "{token.value}"', ) if conf['forbid-inf'] and IS_INF_PATTERN.match(val): yield LintProblem( token.start_mark.line + 1, token.start_mark.column + 1, - f"forbidden infinite value {token.value}", + f'forbidden infinite value "{token.value}"', ) if conf[ @@ -145,7 +145,7 @@ def check(conf, token, prev, next, nextnext, context): yield LintProblem( token.start_mark.line + 1, token.start_mark.column + 1, - f"forbidden scientific notation {token.value}", + f'forbidden scientific notation "{token.value}"', ) if conf[ @@ -154,5 +154,5 @@ def check(conf, token, prev, next, nextnext, context): yield LintProblem( token.start_mark.line + 1, token.start_mark.column + 1, - f"forbidden decimal missing 0 prefix {token.value}", + f'forbidden decimal missing 0 prefix "{token.value}"', )