diff options
-rw-r--r-- | .pre-commit-config.yaml | 2 | ||||
-rw-r--r-- | pylint/checkers/base.py | 4 | ||||
-rw-r--r-- | pylint/checkers/base_checker.py | 2 | ||||
-rw-r--r-- | pylint/checkers/classes.py | 4 | ||||
-rw-r--r-- | pylint/checkers/design_analysis.py | 2 | ||||
-rw-r--r-- | pylint/checkers/format.py | 2 | ||||
-rw-r--r-- | pylint/checkers/raw_metrics.py | 2 | ||||
-rw-r--r-- | pylint/checkers/refactoring/refactoring_checker.py | 2 | ||||
-rw-r--r-- | pylint/checkers/utils.py | 2 | ||||
-rw-r--r-- | pylint/checkers/variables.py | 2 | ||||
-rw-r--r-- | pylint/config/man_help_formatter.py | 4 | ||||
-rw-r--r-- | pylint/config/option.py | 2 | ||||
-rw-r--r-- | pylint/config/option_parser.py | 2 | ||||
-rw-r--r-- | pylint/extensions/check_elif.py | 2 | ||||
-rw-r--r-- | pylint/pyreverse/diadefslib.py | 3 | ||||
-rw-r--r-- | pylint/pyreverse/diagrams.py | 6 | ||||
-rw-r--r-- | pylint/pyreverse/main.py | 2 | ||||
-rw-r--r-- | pylint/pyreverse/utils.py | 2 | ||||
-rw-r--r-- | pylint/reporters/collecting_reporter.py | 2 | ||||
-rw-r--r-- | pylint/reporters/text.py | 6 | ||||
-rw-r--r-- | pylint/testutils/output_line.py | 2 |
21 files changed, 26 insertions, 31 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 82fe526b0..599b60694 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,7 @@ repos: - --remove-duplicate-keys - --remove-unused-variables - repo: https://github.com/asottile/pyupgrade - rev: v2.26.0 + rev: v2.28.0 hooks: - id: pyupgrade args: [--py36-plus] diff --git a/pylint/checkers/base.py b/pylint/checkers/base.py index 4578fbc5b..c1ad797a8 100644 --- a/pylint/checkers/base.py +++ b/pylint/checkers/base.py @@ -1085,7 +1085,7 @@ class BasicChecker(_BasicChecker): reports = (("RP0101", "Statistics by type", report_by_type_stats),) def __init__(self, linter): - _BasicChecker.__init__(self, linter) + super().__init__(linter) self.stats: CheckerStats = {} self._tryfinallys = None @@ -1835,7 +1835,7 @@ class NameChecker(_BasicChecker): KEYWORD_ONSET = {(3, 7): {"async", "await"}} def __init__(self, linter): - _BasicChecker.__init__(self, linter) + super().__init__(linter) self._name_category = {} self._name_group = {} self._bad_names = {} diff --git a/pylint/checkers/base_checker.py b/pylint/checkers/base_checker.py index 16a782f74..938ae792e 100644 --- a/pylint/checkers/base_checker.py +++ b/pylint/checkers/base_checker.py @@ -53,7 +53,7 @@ class BaseChecker(OptionsProviderMixIn): :param ILinter linter: is an object implementing ILinter.""" if self.name is not None: self.name = self.name.lower() - OptionsProviderMixIn.__init__(self) + super().__init__() self.linter = linter self.stats: CheckerStats = {} diff --git a/pylint/checkers/classes.py b/pylint/checkers/classes.py index e6df7214e..9e0a3b07f 100644 --- a/pylint/checkers/classes.py +++ b/pylint/checkers/classes.py @@ -823,7 +823,7 @@ a metaclass class method.", ) def __init__(self, linter=None): - BaseChecker.__init__(self, linter) + super().__init__(linter) self._accessed = ScopeAccessMap() self._first_attrs = [] self._meth_could_be_func = None @@ -2131,7 +2131,7 @@ class SpecialMethodsChecker(BaseChecker): priority = -2 def __init__(self, linter=None): - BaseChecker.__init__(self, linter) + super().__init__(linter) self._protocol_map = { "__iter__": self._check_iter, "__len__": self._check_len, diff --git a/pylint/checkers/design_analysis.py b/pylint/checkers/design_analysis.py index 971a397ce..828537793 100644 --- a/pylint/checkers/design_analysis.py +++ b/pylint/checkers/design_analysis.py @@ -406,7 +406,7 @@ class MisdesignChecker(BaseChecker): ) def __init__(self, linter=None): - BaseChecker.__init__(self, linter) + super().__init__(linter) self.stats: CheckerStats = {} self._returns = None self._branches = None diff --git a/pylint/checkers/format.py b/pylint/checkers/format.py index f79fd6415..e0d627e1c 100644 --- a/pylint/checkers/format.py +++ b/pylint/checkers/format.py @@ -335,7 +335,7 @@ class FormatChecker(BaseTokenChecker): ) def __init__(self, linter=None): - BaseTokenChecker.__init__(self, linter) + super().__init__(linter) self._lines = None self._visited_lines = None self._bracket_stack = [None] diff --git a/pylint/checkers/raw_metrics.py b/pylint/checkers/raw_metrics.py index 0cb707427..c8db0d238 100644 --- a/pylint/checkers/raw_metrics.py +++ b/pylint/checkers/raw_metrics.py @@ -71,7 +71,7 @@ class RawMetricsChecker(BaseTokenChecker): reports = (("RP0701", "Raw metrics", report_raw_stats),) def __init__(self, linter): - BaseTokenChecker.__init__(self, linter) + super().__init__(linter) self.stats: CheckerStats = {} def open(self): diff --git a/pylint/checkers/refactoring/refactoring_checker.py b/pylint/checkers/refactoring/refactoring_checker.py index c90e550d2..c6a9024fb 100644 --- a/pylint/checkers/refactoring/refactoring_checker.py +++ b/pylint/checkers/refactoring/refactoring_checker.py @@ -463,7 +463,7 @@ class RefactoringChecker(checkers.BaseTokenChecker): priority = 0 def __init__(self, linter=None): - checkers.BaseTokenChecker.__init__(self, linter) + super().__init__(linter) self._return_nodes = {} self._consider_using_with_stack = ConsiderUsingWithStack() self._init() diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py index d37c8ab5d..7f04e22f7 100644 --- a/pylint/checkers/utils.py +++ b/pylint/checkers/utils.py @@ -482,7 +482,7 @@ class UnsupportedFormatCharacter(Exception): format characters.""" def __init__(self, index): - Exception.__init__(self, index) + super().__init__(index) self.index = index diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index 1390b619f..d77cba6fd 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -706,7 +706,7 @@ class VariablesChecker(BaseChecker): ) def __init__(self, linter=None): - BaseChecker.__init__(self, linter) + super().__init__(linter) self._to_consume = ( None # list of tuples: (to_consume:dict, consumed:dict, scope_type:str) ) diff --git a/pylint/config/man_help_formatter.py b/pylint/config/man_help_formatter.py index 4b078146d..b265d654c 100644 --- a/pylint/config/man_help_formatter.py +++ b/pylint/config/man_help_formatter.py @@ -11,9 +11,7 @@ class _ManHelpFormatter(optparse.HelpFormatter): def __init__( self, indent_increment=0, max_help_position=24, width=79, short_first=0 ): - optparse.HelpFormatter.__init__( - self, indent_increment, max_help_position, width, short_first - ) + super().__init__(indent_increment, max_help_position, width, short_first) self.output_level: int def format_heading(self, heading): diff --git a/pylint/config/option.py b/pylint/config/option.py index 078c638d3..5b4ae2eb2 100644 --- a/pylint/config/option.py +++ b/pylint/config/option.py @@ -139,7 +139,7 @@ class Option(optparse.Option): TYPE_CHECKER["py_version"] = _py_version_validator def __init__(self, *opts, **attrs): - optparse.Option.__init__(self, *opts, **attrs) + super().__init__(*opts, **attrs) if hasattr(self, "hide") and self.hide: self.help = optparse.SUPPRESS_HELP diff --git a/pylint/config/option_parser.py b/pylint/config/option_parser.py index ceae3c719..16d1ea87e 100644 --- a/pylint/config/option_parser.py +++ b/pylint/config/option_parser.py @@ -17,7 +17,7 @@ def _level_options(group, outputlevel): class OptionParser(optparse.OptionParser): def __init__(self, option_class, *args, **kwargs): - optparse.OptionParser.__init__(self, option_class=Option, *args, **kwargs) + super().__init__(option_class=Option, *args, **kwargs) def format_option_help(self, formatter=None): if formatter is None: diff --git a/pylint/extensions/check_elif.py b/pylint/extensions/check_elif.py index 67dbd0d9c..8dcfb74b3 100644 --- a/pylint/extensions/check_elif.py +++ b/pylint/extensions/check_elif.py @@ -34,7 +34,7 @@ class ElseifUsedChecker(BaseTokenChecker): } def __init__(self, linter=None): - BaseTokenChecker.__init__(self, linter) + super().__init__(linter) self._init() def _init(self): diff --git a/pylint/pyreverse/diadefslib.py b/pylint/pyreverse/diadefslib.py index 508bbfa82..51b3ae804 100644 --- a/pylint/pyreverse/diadefslib.py +++ b/pylint/pyreverse/diadefslib.py @@ -187,9 +187,6 @@ class ClassDiadefGenerator(DiaDefGenerator): given class """ - def __init__(self, linker, handler): - DiaDefGenerator.__init__(self, linker, handler) - def class_diagram(self, project, klass): """return a class diagram definition for the given klass and its related klasses diff --git a/pylint/pyreverse/diagrams.py b/pylint/pyreverse/diagrams.py index 27aec8159..5c82df1e6 100644 --- a/pylint/pyreverse/diagrams.py +++ b/pylint/pyreverse/diagrams.py @@ -32,7 +32,7 @@ class Relationship(Figure): """a relation ship from an object in the diagram to another""" def __init__(self, from_object, to_object, relation_type, name=None): - Figure.__init__(self) + super().__init__() self.from_object = from_object self.to_object = to_object self.type = relation_type @@ -43,7 +43,7 @@ class DiagramEntity(Figure): """a diagram object, i.e. a label associated to an astroid node""" def __init__(self, title="No name", node=None): - Figure.__init__(self) + super().__init__() self.title = title self.node = node @@ -254,7 +254,7 @@ class PackageDiagram(ClassDiagram): def extract_relationships(self): """extract relation ships between nodes in the diagram""" - ClassDiagram.extract_relationships(self) + super().extract_relationships() for obj in self.classes(): # ownership try: diff --git a/pylint/pyreverse/main.py b/pylint/pyreverse/main.py index 7e4aff102..0fe8f5f21 100644 --- a/pylint/pyreverse/main.py +++ b/pylint/pyreverse/main.py @@ -200,7 +200,7 @@ class Run(ConfigurationMixIn): options = OPTIONS def __init__(self, args: Iterable[str]): - ConfigurationMixIn.__init__(self, usage=__doc__) + super().__init__(usage=__doc__) insert_default_options() args = self.load_command_line_configuration(args) if self.config.output_format not in ("dot", "vcg"): diff --git a/pylint/pyreverse/utils.py b/pylint/pyreverse/utils.py index 904f6eacb..f6dafcbab 100644 --- a/pylint/pyreverse/utils.py +++ b/pylint/pyreverse/utils.py @@ -203,7 +203,7 @@ class LocalsVisitor(ASTWalker): """visit a project by traversing the locals dictionary""" def __init__(self): - ASTWalker.__init__(self, self) + super().__init__(self) self._visited = set() def visit(self, node): diff --git a/pylint/reporters/collecting_reporter.py b/pylint/reporters/collecting_reporter.py index fbd9eb46b..70f313bb3 100644 --- a/pylint/reporters/collecting_reporter.py +++ b/pylint/reporters/collecting_reporter.py @@ -14,7 +14,7 @@ class CollectingReporter(BaseReporter): name = "collector" def __init__(self) -> None: - BaseReporter.__init__(self) + super().__init__() self.messages = [] def reset(self) -> None: diff --git a/pylint/reporters/text.py b/pylint/reporters/text.py index 6caa9b913..8af3f879c 100644 --- a/pylint/reporters/text.py +++ b/pylint/reporters/text.py @@ -180,7 +180,7 @@ class TextReporter(BaseReporter): line_format = "{path}:{line}:{column}: {msg_id}: {msg} ({symbol})" def __init__(self, output: Optional[TextIO] = None) -> None: - BaseReporter.__init__(self, output) + super().__init__(output) self._modules: Set[str] = set() self._template = self.line_format @@ -222,7 +222,7 @@ class ParseableTextReporter(TextReporter): f"{self.name} output format is deprecated. This is equivalent to --msg-template={self.line_format}", DeprecationWarning, ) - TextReporter.__init__(self, output) + super().__init__(output) class VSTextReporter(ParseableTextReporter): @@ -270,7 +270,7 @@ class ColorizedTextReporter(TextReporter): ColorMappingDict, Dict[str, Tuple[Optional[str], Optional[str]]], None ] = None, ) -> None: - TextReporter.__init__(self, output) + super().__init__(output) # pylint: disable-next=fixme # TODO: Remove DeprecationWarning and only accept ColorMappingDict as color_mapping parameter if color_mapping and not isinstance( diff --git a/pylint/testutils/output_line.py b/pylint/testutils/output_line.py index 73dca5b01..9a07642e4 100644 --- a/pylint/testutils/output_line.py +++ b/pylint/testutils/output_line.py @@ -70,7 +70,7 @@ Expected '{example}' or '{other_example}' but we got '{raw}': {reconstructed_row} Try updating it with: 'python tests/test_functional.py {UPDATE_OPTION}'""" - Exception.__init__(self, msg) + super().__init__(msg) class OutputLine(NamedTuple): |