diff --git a/.pylintrc b/.pylintrc index 6f587e3..9cf7e6b 100644 --- a/.pylintrc +++ b/.pylintrc @@ -30,10 +30,8 @@ disable= too-many-locals, too-many-return-statements, too-many-statements, - unnecessary-pass, unspecified-encoding, unused-argument, - useless-object-inheritance, useless-option-value, # disables warning in recent pylint that does not check for no-self-use anymore [REPORTS] diff --git a/picireny/antlr4/antlr_tree.py b/picireny/antlr4/antlr_tree.py index afa9cf3..891b90c 100644 --- a/picireny/antlr4/antlr_tree.py +++ b/picireny/antlr4/antlr_tree.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2021 Renata Hodovan, Akos Kiss. +# Copyright (c) 2016-2023 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # . @@ -15,7 +15,7 @@ # Parser Elements -class ANTLRElement(object): +class ANTLRElement: def __init__(self, *, optional=False, repl=None, sep=''): """ Constructor of the base tree node type. diff --git a/picireny/antlr4/hdd_tree_builder.py b/picireny/antlr4/hdd_tree_builder.py index ee096e9..5eda108 100644 --- a/picireny/antlr4/hdd_tree_builder.py +++ b/picireny/antlr4/hdd_tree_builder.py @@ -43,7 +43,6 @@ class HDDHiddenToken(HDDToken): """ Special token type that represents tokens from hidden channels. """ - pass class HDDErrorToken(HDDToken): diff --git a/picireny/hdd_tree.py b/picireny/hdd_tree.py index 3ea0b91..4f6caed 100644 --- a/picireny/hdd_tree.py +++ b/picireny/hdd_tree.py @@ -1,5 +1,5 @@ # Copyright (c) 2007 Ghassan Misherghi. -# Copyright (c) 2016-2022 Renata Hodovan, Akos Kiss. +# Copyright (c) 2016-2023 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # . @@ -10,7 +10,7 @@ from os import linesep -class Position(object): +class Position: """ Class defining a position in the input file. Used to recognise line breaks between tokens. @@ -51,7 +51,7 @@ def __repr__(self): return f'{self.__class__.__name__}({self.line!r}, {self.column!r})' -class HDDTree(object): +class HDDTree: # Node states for unparsing. REMOVED = 0 KEEP = 1 diff --git a/picireny/hoist.py b/picireny/hoist.py index 6fd4e2a..4d9f494 100644 --- a/picireny/hoist.py +++ b/picireny/hoist.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Renata Hodovan, Akos Kiss. +# Copyright (c) 2021-2023 Renata Hodovan, Akos Kiss. # Copyright (c) 2021 Daniel Vince. # # Licensed under the BSD 3-Clause License @@ -14,7 +14,7 @@ logger = logging.getLogger(__name__) -class HoistingTestBuilder(object): +class HoistingTestBuilder: def __init__(self, tree, *, with_whitespace=True): """ diff --git a/picireny/prune.py b/picireny/prune.py index 1d9e474..1552159 100644 --- a/picireny/prune.py +++ b/picireny/prune.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Renata Hodovan, Akos Kiss. +# Copyright (c) 2021-2023 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # . @@ -14,7 +14,7 @@ logger = logging.getLogger(__name__) -class PruningTestBuilder(object): +class PruningTestBuilder: def __init__(self, tree, ids, *, with_whitespace=True): """