mirror of
https://github.com/adrienverge/yamllint.git
synced 2024-11-22 07:36:25 -06:00
No need to inherit from object
in Python 3
This commit is contained in:
parent
4c7b47daf3
commit
ae3158cd1f
@ -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):
|
||||
|
@ -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))
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -64,7 +64,7 @@ TYPE = 'token'
|
||||
MAP, SEQ = range(2)
|
||||
|
||||
|
||||
class Parent(object):
|
||||
class Parent:
|
||||
def __init__(self, type):
|
||||
self.type = type
|
||||
self.keys = []
|
||||
|
Loading…
Reference in New Issue
Block a user