Skip to content

Commit

Permalink
Pylint-induced maintenance (#41)
Browse files Browse the repository at this point in the history
- Remove the explicit `object` superclass definition from classes.
  In Python3, object is the implicit superclass. There is no need
  to explicitly define it.
- Remove unnecessary pass.
  • Loading branch information
akosthekiss committed Nov 5, 2023
1 parent dfd15fe commit a5fe331
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
2 changes: 0 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions picireny/antlr4/antlr_tree.py
Original file line number Diff line number Diff line change
@@ -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
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
Expand All @@ -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.
Expand Down
1 change: 0 additions & 1 deletion picireny/antlr4/hdd_tree_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class HDDHiddenToken(HDDToken):
"""
Special token type that represents tokens from hidden channels.
"""
pass


class HDDErrorToken(HDDToken):
Expand Down
6 changes: 3 additions & 3 deletions picireny/hdd_tree.py
Original file line number Diff line number Diff line change
@@ -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
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions picireny/hoist.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -14,7 +14,7 @@
logger = logging.getLogger(__name__)


class HoistingTestBuilder(object):
class HoistingTestBuilder:

def __init__(self, tree, *, with_whitespace=True):
"""
Expand Down
4 changes: 2 additions & 2 deletions picireny/prune.py
Original file line number Diff line number Diff line change
@@ -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
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
Expand All @@ -14,7 +14,7 @@
logger = logging.getLogger(__name__)


class PruningTestBuilder(object):
class PruningTestBuilder:

def __init__(self, tree, ids, *, with_whitespace=True):
"""
Expand Down

0 comments on commit a5fe331

Please sign in to comment.