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:
parent
cebc9c1fcc
commit
f977ae25bf
@ -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):
|
||||
|
@ -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}')
|
||||
|
Loading…
Reference in New Issue
Block a user