From 47cd8f2e9e1258aca9d3c02c7782d0edf9081938 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Sat, 15 Oct 2022 22:32:20 +0200 Subject: [PATCH] No need to inherit from `object` in Python 3 --- yamllint/cli.py | 2 +- yamllint/linter.py | 2 +- yamllint/rules/key_ordering.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/yamllint/cli.py b/yamllint/cli.py index ea0d704..0ceed35 100644 --- a/yamllint/cli.py +++ b/yamllint/cli.py @@ -47,7 +47,7 @@ def supports_color(): hasattr(sys.stdout, 'isatty') and sys.stdout.isatty()) -class Format(object): +class Format: @staticmethod def parsable(problem, filename): return ('%(file)s:%(line)s:%(column)s: [%(level)s] %(message)s' % diff --git a/yamllint/linter.py b/yamllint/linter.py index a50298a..d250598 100644 --- a/yamllint/linter.py +++ b/yamllint/linter.py @@ -34,7 +34,7 @@ DISABLE_RULE_PATTERN = re.compile(r'^# yamllint disable( rule:\S+)*\s*$') ENABLE_RULE_PATTERN = re.compile(r'^# yamllint enable( rule:\S+)*\s*$') -class LintProblem(object): +class LintProblem: """Represents a linting problem found by yamllint.""" def __init__(self, line, column, desc='', rule=None): #: Line on which the problem was found (starting at 1) diff --git a/yamllint/rules/key_ordering.py b/yamllint/rules/key_ordering.py index ddbc24f..ad38ed7 100644 --- a/yamllint/rules/key_ordering.py +++ b/yamllint/rules/key_ordering.py @@ -93,7 +93,7 @@ TYPE = 'token' MAP, SEQ = range(2) -class Parent(object): +class Parent: def __init__(self, type): self.type = type self.keys = []