style: Use f-strings wherever possible

This commit is contained in:
Dimitri Papadopoulos 2023-12-31 12:12:40 +01:00 committed by Adrien Vergé
parent cebc9c1fcc
commit f977ae25bf
2 changed files with 4 additions and 4 deletions

View File

@ -50,8 +50,8 @@ class IndentationStackTestCase(RuleTestCase):
.replace('Mapping', 'Map'))
if token_type in ('StreamStart', 'StreamEnd'):
continue
output += '{:>9} {}\n'.format(token_type,
self.format_stack(context['stack']))
stack = self.format_stack(context['stack'])
output += f'{token_type:>9} {stack}\n'
return output
def test_simple_mapping(self):

View File

@ -54,6 +54,6 @@ def check(conf, line):
if line.start == 0 and len(line.buffer) > line.end:
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,
'wrong new line character: expected {}'
.format(repr(newline_char).strip('\'')))
f'wrong new line character: expected {c}')