Skip to content

Commit

Permalink
float-values: Add missing quotes in problems messages
Browse files Browse the repository at this point in the history
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"
  • Loading branch information
adrienverge committed Jul 8, 2022
1 parent 8ac7d58 commit e6af957
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions yamllint/rules/float_values.py
Expand Up @@ -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[
Expand All @@ -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[
Expand All @@ -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}"',
)

0 comments on commit e6af957

Please sign in to comment.