mirror of
https://github.com/adrienverge/yamllint.git
synced 2025-02-25 18:55:20 -06:00
Upgrade Python syntax with pyupgrade
https://github.com/asottile/pyupgrade
This commit is contained in:
parent
5852566ff0
commit
f4c56b8216
@ -51,8 +51,8 @@ class IndentationStackTestCase(RuleTestCase):
|
||||
.replace('Mapping', 'Map'))
|
||||
if token_type in ('StreamStart', 'StreamEnd'):
|
||||
continue
|
||||
output += '%9s %s\n' % (token_type,
|
||||
self.format_stack(context['stack']))
|
||||
output += '{:>9} {}\n'.format(token_type,
|
||||
self.format_stack(context['stack']))
|
||||
return output
|
||||
|
||||
def test_simple_mapping(self):
|
||||
|
@ -103,7 +103,7 @@ def run(argv=None):
|
||||
help='return non-zero exit code on warnings '
|
||||
'as well as errors')
|
||||
parser.add_argument('-v', '--version', action='version',
|
||||
version='%s %s' % (APP_NAME, APP_VERSION))
|
||||
version='{} {}'.format(APP_NAME, APP_VERSION))
|
||||
|
||||
# TODO: read from stdin when no filename?
|
||||
|
||||
|
@ -47,7 +47,7 @@ class LintProblem(object):
|
||||
@property
|
||||
def message(self):
|
||||
if self.rule is not None:
|
||||
return '%s (%s)' % (self.desc, self.rule)
|
||||
return '{} ({})'.format(self.desc, self.rule)
|
||||
return self.desc
|
||||
|
||||
def __eq__(self, other):
|
||||
@ -78,7 +78,7 @@ def get_cosmetic_problems(buffer, conf, filepath):
|
||||
class DisableDirective:
|
||||
def __init__(self):
|
||||
self.rules = set()
|
||||
self.all_rules = set([r.ID for r in rules])
|
||||
self.all_rules = {r.ID for r in rules}
|
||||
|
||||
def process_comment(self, comment):
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user