No need to inherit from object in Python 3

This commit is contained in:
Dimitri Papadopoulos 2022-07-17 08:29:15 +02:00 committed by Adrien Vergé
parent 4c7b47daf3
commit ae3158cd1f
6 changed files with 8 additions and 8 deletions

View File

@ -29,7 +29,7 @@ from yamllint import cli
from yamllint import config
class RunContext(object):
class RunContext:
"""Context manager for ``cli.run()`` to capture exit code and streams."""
def __init__(self, case):

View File

@ -121,7 +121,7 @@ class SimpleConfigTestCase(unittest.TestCase):
self.assertEqual(c.rules['hyphens'], False)
def test_validate_rule_conf(self):
class Rule(object):
class Rule:
ID = 'fake'
self.assertFalse(config.validate_rule_conf(Rule, False))

View File

@ -25,7 +25,7 @@ class YamlLintConfigError(Exception):
pass
class YamlLintConfig(object):
class YamlLintConfig:
def __init__(self, content=None, file=None):
assert (content is None) ^ (file is None)

View File

@ -16,7 +16,7 @@
import yaml
class Line(object):
class Line:
def __init__(self, line_no, buffer, start, end):
self.line_no = line_no
self.start = start
@ -28,7 +28,7 @@ class Line(object):
return self.buffer[self.start:self.end]
class Token(object):
class Token:
def __init__(self, line_no, curr, prev, next, nextnext):
self.line_no = line_no
self.curr = curr
@ -37,7 +37,7 @@ class Token(object):
self.nextnext = nextnext
class Comment(object):
class Comment:
def __init__(self, line_no, column_no, buffer, pointer,
token_before=None, token_after=None, comment_before=None):
self.line_no = line_no

View File

@ -218,7 +218,7 @@ ROOT, B_MAP, F_MAP, B_SEQ, F_SEQ, B_ENT, KEY, VAL = range(8)
labels = ('ROOT', 'B_MAP', 'F_MAP', 'B_SEQ', 'F_SEQ', 'B_ENT', 'KEY', 'VAL')
class Parent(object):
class Parent:
def __init__(self, type, indent, line_indent=None):
self.type = type
self.indent = indent

View File

@ -64,7 +64,7 @@ TYPE = 'token'
MAP, SEQ = range(2)
class Parent(object):
class Parent:
def __init__(self, type):
self.type = type
self.keys = []