mirror of
https://github.com/adrienverge/yamllint.git
synced 2025-02-25 18:55:20 -06:00
style: Use f-strings wherever possible
This commit is contained in:
committed by
Adrien Vergé
parent
cebc9c1fcc
commit
f977ae25bf
@@ -50,8 +50,8 @@ class IndentationStackTestCase(RuleTestCase):
|
|||||||
.replace('Mapping', 'Map'))
|
.replace('Mapping', 'Map'))
|
||||||
if token_type in ('StreamStart', 'StreamEnd'):
|
if token_type in ('StreamStart', 'StreamEnd'):
|
||||||
continue
|
continue
|
||||||
output += '{:>9} {}\n'.format(token_type,
|
stack = self.format_stack(context['stack'])
|
||||||
self.format_stack(context['stack']))
|
output += f'{token_type:>9} {stack}\n'
|
||||||
return output
|
return output
|
||||||
|
|
||||||
def test_simple_mapping(self):
|
def test_simple_mapping(self):
|
||||||
|
|||||||
@@ -54,6 +54,6 @@ def check(conf, line):
|
|||||||
|
|
||||||
if line.start == 0 and len(line.buffer) > line.end:
|
if line.start == 0 and len(line.buffer) > line.end:
|
||||||
if line.buffer[line.end:line.end + len(newline_char)] != newline_char:
|
if line.buffer[line.end:line.end + len(newline_char)] != newline_char:
|
||||||
|
c = repr(newline_char).strip('\'')
|
||||||
yield LintProblem(1, line.end - line.start + 1,
|
yield LintProblem(1, line.end - line.start + 1,
|
||||||
'wrong new line character: expected {}'
|
f'wrong new line character: expected {c}')
|
||||||
.format(repr(newline_char).strip('\'')))
|
|
||||||
|
|||||||
Reference in New Issue
Block a user