diff --git a/tests/test_cli.py b/tests/test_cli.py index 3ac5b09d..7d164128 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -29,7 +29,7 @@ from yamllint import config -class RunContext(object): +class RunContext: """Context manager for ``cli.run()`` to capture exit code and streams.""" def __init__(self, case): diff --git a/tests/test_config.py b/tests/test_config.py index 3618a303..c84be1e1 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -121,7 +121,7 @@ def test_enable_disable_keywords(self): 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)) diff --git a/yamllint/config.py b/yamllint/config.py index 4fc9ef6f..939fe4ad 100644 --- a/yamllint/config.py +++ b/yamllint/config.py @@ -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) diff --git a/yamllint/parser.py b/yamllint/parser.py index 086613fd..d6b71d92 100644 --- a/yamllint/parser.py +++ b/yamllint/parser.py @@ -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 @@ def content(self): 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 @@ def __init__(self, line_no, curr, prev, next, nextnext): 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 diff --git a/yamllint/rules/indentation.py b/yamllint/rules/indentation.py index dfee0f20..3853f6f5 100644 --- a/yamllint/rules/indentation.py +++ b/yamllint/rules/indentation.py @@ -218,7 +218,7 @@ 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 diff --git a/yamllint/rules/key_duplicates.py b/yamllint/rules/key_duplicates.py index 371d2ed4..3f93e7dc 100644 --- a/yamllint/rules/key_duplicates.py +++ b/yamllint/rules/key_duplicates.py @@ -64,7 +64,7 @@ MAP, SEQ = range(2) -class Parent(object): +class Parent: def __init__(self, type): self.type = type self.keys = []