The following issues were found

pipenv/patched/notpip/_vendor/html5lib/treeadapters/genshi.py
8 issues
Unable to import 'genshi.core'
Error

Line: 3 Column: 1

              from __future__ import absolute_import, division, unicode_literals

from genshi.core import QName, Attrs
from genshi.core import START, END, TEXT, COMMENT, DOCTYPE


def to_genshi(walker):
    """Convert a tree to a genshi tree


            

Reported by Pylint.

No name 'core' in module 'genshi'
Error

Line: 3 Column: 1

              from __future__ import absolute_import, division, unicode_literals

from genshi.core import QName, Attrs
from genshi.core import START, END, TEXT, COMMENT, DOCTYPE


def to_genshi(walker):
    """Convert a tree to a genshi tree


            

Reported by Pylint.

No name 'core' in module 'genshi'
Error

Line: 4 Column: 1

              from __future__ import absolute_import, division, unicode_literals

from genshi.core import QName, Attrs
from genshi.core import START, END, TEXT, COMMENT, DOCTYPE


def to_genshi(walker):
    """Convert a tree to a genshi tree


            

Reported by Pylint.

Unable to import 'genshi.core'
Error

Line: 4 Column: 1

              from __future__ import absolute_import, division, unicode_literals

from genshi.core import QName, Attrs
from genshi.core import START, END, TEXT, COMMENT, DOCTYPE


def to_genshi(walker):
    """Convert a tree to a genshi tree


            

Reported by Pylint.

Redefining built-in 'type'
Error

Line: 17 Column: 9

                  """
    text = []
    for token in walker:
        type = token["type"]
        if type in ("Characters", "SpaceCharacters"):
            text.append(token["data"])
        elif text:
            yield TEXT, "".join(text), (None, -1, -1)
            text = []

            

Reported by Pylint.

FIXME: What to do?
Error

Line: 51 Column: 3

                                          token["systemId"]), (None, -1, -1)

        else:
            pass  # FIXME: What to do?

    if text:
        yield TEXT, "".join(text), (None, -1, -1)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import, division, unicode_literals

from genshi.core import QName, Attrs
from genshi.core import START, END, TEXT, COMMENT, DOCTYPE


def to_genshi(walker):
    """Convert a tree to a genshi tree


            

Reported by Pylint.

Too many branches (14/12)
Error

Line: 7 Column: 1

              from genshi.core import START, END, TEXT, COMMENT, DOCTYPE


def to_genshi(walker):
    """Convert a tree to a genshi tree

    :arg walker: the treewalker to use to walk the tree to convert it

    :returns: generator of genshi nodes

            

Reported by Pylint.

pipenv/vendor/certifi/core.py
8 issues
Generator 'generator' has no '__enter__' member
Error

Line: 37 Column: 32

                          # it will do the cleanup whenever it gets garbage collected, so
            # we will also store that at the global level as well.
            _CACERT_CTX = get_path("certifi", "cacert.pem")
            _CACERT_PATH = str(_CACERT_CTX.__enter__())

        return _CACERT_PATH


except ImportError:

            

Reported by Pylint.

Using the global statement
Error

Line: 23 Column: 9

                      # actually calls where(), but we don't want to re-extract the file
        # on every call of where(), so we'll do it once then store it in a
        # global variable.
        global _CACERT_CTX
        global _CACERT_PATH
        if _CACERT_PATH is None:
            # This is slightly janky, the importlib.resources API wants you to
            # manage the cleanup of this file, so it doesn't actually return a
            # path, it returns a context manager that will give you the path

            

Reported by Pylint.

Using the global statement
Error

Line: 24 Column: 9

                      # on every call of where(), so we'll do it once then store it in a
        # global variable.
        global _CACERT_CTX
        global _CACERT_PATH
        if _CACERT_PATH is None:
            # This is slightly janky, the importlib.resources API wants you to
            # manage the cleanup of this file, so it doesn't actually return a
            # path, it returns a context manager that will give you the path
            # when you enter it and will do any cleanup when you leave it. In

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 17 Column: 5

                  _CACERT_CTX = None
    _CACERT_PATH = None

    def where():
        # This is slightly terrible, but we want to delay extracting the file
        # in cases where we're inside of a zipimport situation until someone
        # actually calls where(), but we don't want to re-extract the file
        # on every call of where(), so we'll do it once then store it in a
        # global variable.

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 47 Column: 5

                  # importlib.resources module but relies on the existing `where` function
    # so won't address issues with environments like PyOxidizer that don't set
    # __file__ on modules.
    def read_text(_module, _path, encoding="ascii"):
        with open(where(), "r", encoding=encoding) as data:
            return data.read()

    # If we don't have importlib.resources, then we will just do the old logic
    # of assuming we're on the filesystem and munge the path directly.

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 53 Column: 5

              
    # If we don't have importlib.resources, then we will just do the old logic
    # of assuming we're on the filesystem and munge the path directly.
    def where():
        f = os.path.dirname(__file__)

        return os.path.join(f, "cacert.pem")



            

Reported by Pylint.

Variable name "f" doesn't conform to snake_case naming style
Error

Line: 54 Column: 9

                  # If we don't have importlib.resources, then we will just do the old logic
    # of assuming we're on the filesystem and munge the path directly.
    def where():
        f = os.path.dirname(__file__)

        return os.path.join(f, "cacert.pem")


def contents():

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 59 Column: 1

                      return os.path.join(f, "cacert.pem")


def contents():
    return read_text("certifi", "cacert.pem", encoding="ascii")

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/html5lib/_trie/_base.py
8 issues
Method '__iter__' is abstract in class 'Iterable' but is not overridden
Error

Line: 9 Column: 1

                  from collections import Mapping


class Trie(Mapping):
    """Abstract base class for tries"""

    def keys(self, prefix=None):
        # pylint:disable=arguments-differ
        keys = super(Trie, self).keys()

            

Reported by Pylint.

Method '__len__' is abstract in class 'Sized' but is not overridden
Error

Line: 9 Column: 1

                  from collections import Mapping


class Trie(Mapping):
    """Abstract base class for tries"""

    def keys(self, prefix=None):
        # pylint:disable=arguments-differ
        keys = super(Trie, self).keys()

            

Reported by Pylint.

Method '__getitem__' is abstract in class 'Mapping' but is not overridden
Error

Line: 9 Column: 1

                  from collections import Mapping


class Trie(Mapping):
    """Abstract base class for tries"""

    def keys(self, prefix=None):
        # pylint:disable=arguments-differ
        keys = super(Trie, self).keys()

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import, division, unicode_literals

try:
    from collections.abc import Mapping
except ImportError:  # Python 2.7
    from collections import Mapping


class Trie(Mapping):

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 14 Column: 16

              
    def keys(self, prefix=None):
        # pylint:disable=arguments-differ
        keys = super(Trie, self).keys()

        if prefix is None:
            return set(keys)

        return {x for x in keys if x.startswith(prefix)}

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 21 Column: 5

              
        return {x for x in keys if x.startswith(prefix)}

    def has_keys_with_prefix(self, prefix):
        for key in self.keys():
            if key.startswith(prefix):
                return True

        return False

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 28 Column: 5

              
        return False

    def longest_prefix(self, prefix):
        if prefix in self:
            return prefix

        for i in range(1, len(prefix) + 1):
            if prefix[:-i] in self:

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 38 Column: 5

              
        raise KeyError(prefix)

    def longest_prefix_item(self, prefix):
        lprefix = self.longest_prefix(prefix)
        return (lprefix, self[lprefix])

            

Reported by Pylint.

pipenv/patched/notpip/_internal/cli/command_context.py
8 issues
Missing module docstring
Error

Line: 1 Column: 1

              from contextlib import contextmanager

from pipenv.patched.notpip._vendor.contextlib2 import ExitStack

from pipenv.patched.notpip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
    from typing import Iterator, ContextManager, TypeVar


            

Reported by Pylint.

Class 'CommandContextMixIn' inherits from object, can be safely removed from bases in python3
Error

Line: 13 Column: 1

                  _T = TypeVar('_T', covariant=True)


class CommandContextMixIn(object):
    def __init__(self):
        # type: () -> None
        super(CommandContextMixIn, self).__init__()
        self._in_main_context = False
        self._main_context = ExitStack()

            

Reported by Pylint.

Missing class docstring
Error

Line: 13 Column: 1

                  _T = TypeVar('_T', covariant=True)


class CommandContextMixIn(object):
    def __init__(self):
        # type: () -> None
        super(CommandContextMixIn, self).__init__()
        self._in_main_context = False
        self._main_context = ExitStack()

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 16 Column: 9

              class CommandContextMixIn(object):
    def __init__(self):
        # type: () -> None
        super(CommandContextMixIn, self).__init__()
        self._in_main_context = False
        self._main_context = ExitStack()

    @contextmanager
    def main_context(self):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 21 Column: 5

                      self._main_context = ExitStack()

    @contextmanager
    def main_context(self):
        # type: () -> Iterator[None]
        assert not self._in_main_context

        self._in_main_context = True
        try:

            

Reported by Pylint.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 23
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

                  @contextmanager
    def main_context(self):
        # type: () -> Iterator[None]
        assert not self._in_main_context

        self._in_main_context = True
        try:
            with self._main_context:
                yield

            

Reported by Bandit.

Missing function or method docstring
Error

Line: 32 Column: 5

                      finally:
            self._in_main_context = False

    def enter_context(self, context_provider):
        # type: (ContextManager[_T]) -> _T
        assert self._in_main_context

        return self._main_context.enter_context(context_provider)

            

Reported by Pylint.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 34
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

              
    def enter_context(self, context_provider):
        # type: (ContextManager[_T]) -> _T
        assert self._in_main_context

        return self._main_context.enter_context(context_provider)

            

Reported by Bandit.

pipenv/vendor/attr/setters.py
8 issues
Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

              
from __future__ import absolute_import, division, print_function

from . import _config
from .exceptions import FrozenAttributeError


def pipe(*setters):
    """

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              from __future__ import absolute_import, division, print_function

from . import _config
from .exceptions import FrozenAttributeError


def pipe(*setters):
    """
    Run all *setters* and return the return value of the last one.

            

Reported by Pylint.

Access to a protected member _run_validators of a client class
Error

Line: 44 Column: 8

              
    .. versionadded:: 20.1.0
    """
    if _config._run_validators is False:
        return new_value

    v = attrib.validator
    if not v:
        return new_value

            

Reported by Pylint.

Unused argument 'instance'
Error

Line: 56 Column: 13

                  return new_value


def convert(instance, attrib, new_value):
    """
    Run *attrib*'s converter -- if it has one --  on *new_value* and return the
    result.

    .. versionadded:: 20.1.0

            

Reported by Pylint.

Variable name "rv" doesn't conform to snake_case naming style
Error

Line: 19 Column: 9

                  """

    def wrapped_pipe(instance, attrib, new_value):
        rv = new_value

        for setter in setters:
            rv = setter(instance, attrib, rv)

        return rv

            

Reported by Pylint.

Variable name "rv" doesn't conform to snake_case naming style
Error

Line: 22 Column: 13

                      rv = new_value

        for setter in setters:
            rv = setter(instance, attrib, rv)

        return rv

    return wrapped_pipe


            

Reported by Pylint.

Variable name "v" doesn't conform to snake_case naming style
Error

Line: 47 Column: 5

                  if _config._run_validators is False:
        return new_value

    v = attrib.validator
    if not v:
        return new_value

    v(instance, attrib, new_value)


            

Reported by Pylint.

Variable name "c" doesn't conform to snake_case naming style
Error

Line: 63 Column: 5

              
    .. versionadded:: 20.1.0
    """
    c = attrib.converter
    if c:
        return c(new_value)

    return new_value


            

Reported by Pylint.

pipenv/vendor/importlib_resources/tests/_compat.py
8 issues
Unused import_helper imported from test.support
Error

Line: 5 Column: 5

              

try:
    from test.support import import_helper  # type: ignore
except ImportError:
    # Python 3.9 and earlier
    class import_helper:  # type: ignore
        from test.support import modules_setup, modules_cleanup


            

Reported by Pylint.

Unused unlink imported from test.support.os_helper
Error

Line: 14 Column: 5

              
try:
    # Python 3.10
    from test.support.os_helper import unlink
except ImportError:
    from test.support import unlink as _unlink

    def unlink(target):
        return _unlink(os.fspath(target))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import os


try:
    from test.support import import_helper  # type: ignore
except ImportError:
    # Python 3.9 and earlier
    class import_helper:  # type: ignore
        from test.support import modules_setup, modules_cleanup

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 8 Column: 5

                  from test.support import import_helper  # type: ignore
except ImportError:
    # Python 3.9 and earlier
    class import_helper:  # type: ignore
        from test.support import modules_setup, modules_cleanup


try:
    # Python 3.10

            

Reported by Pylint.

Class name "import_helper" doesn't conform to PascalCase naming style
Error

Line: 8 Column: 5

                  from test.support import import_helper  # type: ignore
except ImportError:
    # Python 3.9 and earlier
    class import_helper:  # type: ignore
        from test.support import modules_setup, modules_cleanup


try:
    # Python 3.10

            

Reported by Pylint.

Missing class docstring
Error

Line: 8 Column: 5

                  from test.support import import_helper  # type: ignore
except ImportError:
    # Python 3.9 and earlier
    class import_helper:  # type: ignore
        from test.support import modules_setup, modules_cleanup


try:
    # Python 3.10

            

Reported by Pylint.

Import outside toplevel (test.support.modules_setup, test.support.modules_cleanup)
Error

Line: 9 Column: 9

              except ImportError:
    # Python 3.9 and earlier
    class import_helper:  # type: ignore
        from test.support import modules_setup, modules_cleanup


try:
    # Python 3.10
    from test.support.os_helper import unlink

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 18 Column: 5

              except ImportError:
    from test.support import unlink as _unlink

    def unlink(target):
        return _unlink(os.fspath(target))

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/distlib/_backport/misc.py
8 issues
No name 'Callable' in module 'collections'
Error

Line: 25 Column: 5

              try:
    callable = callable
except NameError:
    from collections import Callable

    def callable(obj):
        return isinstance(obj, Callable)



            

Reported by Pylint.

Redefining built-in 'callable'
Error

Line: 23 Column: 5

              

try:
    callable = callable
except NameError:
    from collections import Callable

    def callable(obj):
        return isinstance(obj, Callable)

            

Reported by Pylint.

Assigning the same variable 'callable' to itself
Error

Line: 23 Column: 5

              

try:
    callable = callable
except NameError:
    from collections import Callable

    def callable(obj):
        return isinstance(obj, Callable)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 17 Column: 5

              try:
    from imp import cache_from_source
except ImportError:
    def cache_from_source(py_file, debug=__debug__):
        ext = debug and 'c' or 'o'
        return py_file + ext


try:

            

Reported by Pylint.

Consider using ternary ('c' if debug else 'o')
Error

Line: 18 Column: 9

                  from imp import cache_from_source
except ImportError:
    def cache_from_source(py_file, debug=__debug__):
        ext = debug and 'c' or 'o'
        return py_file + ext


try:
    callable = callable

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 27 Column: 5

              except NameError:
    from collections import Callable

    def callable(obj):
        return isinstance(obj, Callable)


try:
    fsencode = os.fsencode

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 34 Column: 5

              try:
    fsencode = os.fsencode
except AttributeError:
    def fsencode(filename):
        if isinstance(filename, bytes):
            return filename
        elif isinstance(filename, str):
            return filename.encode(sys.getfilesystemencoding())
        else:

            

Reported by Pylint.

Unnecessary "elif" after "return"
Error

Line: 35 Column: 9

                  fsencode = os.fsencode
except AttributeError:
    def fsencode(filename):
        if isinstance(filename, bytes):
            return filename
        elif isinstance(filename, str):
            return filename.encode(sys.getfilesystemencoding())
        else:
            raise TypeError("expect bytes or str, not %s" %

            

Reported by Pylint.

pipenv/vendor/markupsafe/_native.py
8 issues
Attempted relative import beyond top-level package
Error

Line: 3 Column: 1

              import typing as t

from . import Markup


def escape(s: t.Any) -> Markup:
    """Replace the characters ``&``, ``<``, ``>``, ``'``, and ``"`` in
    the string with HTML-safe sequences. Use this if you need to display
    text that might contain such characters in HTML.

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import typing as t

from . import Markup


def escape(s: t.Any) -> Markup:
    """Replace the characters ``&``, ``<``, ``>``, ``'``, and ``"`` in
    the string with HTML-safe sequences. Use this if you need to display
    text that might contain such characters in HTML.

            

Reported by Pylint.

Argument name "s" doesn't conform to snake_case naming style
Error

Line: 6 Column: 1

              from . import Markup


def escape(s: t.Any) -> Markup:
    """Replace the characters ``&``, ``<``, ``>``, ``'``, and ``"`` in
    the string with HTML-safe sequences. Use this if you need to display
    text that might contain such characters in HTML.

    If the object has an ``__html__`` method, it is called and the

            

Reported by Pylint.

Argument name "s" doesn't conform to snake_case naming style
Error

Line: 30 Column: 1

                  )


def escape_silent(s: t.Optional[t.Any]) -> Markup:
    """Like :func:`escape` but treats ``None`` as the empty string.
    Useful with optional values, as otherwise you get the string
    ``'None'`` when the value is ``None``.

    >>> escape(None)

            

Reported by Pylint.

Argument name "s" doesn't conform to snake_case naming style
Error

Line: 46 Column: 1

                  return escape(s)


def soft_str(s: t.Any) -> str:
    """Convert an object to a string if it isn't already. This preserves
    a :class:`Markup` string rather than converting it back to a basic
    string, so it will still be marked as safe and won't be escaped
    again.


            

Reported by Pylint.

Argument name "s" doesn't conform to snake_case naming style
Error

Line: 66 Column: 1

                  return s


def soft_unicode(s: t.Any) -> str:
    import warnings

    warnings.warn(
        "'soft_unicode' has been renamed to 'soft_str'. The old name"
        " will be removed in MarkupSafe 2.1.",

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 66 Column: 1

                  return s


def soft_unicode(s: t.Any) -> str:
    import warnings

    warnings.warn(
        "'soft_unicode' has been renamed to 'soft_str'. The old name"
        " will be removed in MarkupSafe 2.1.",

            

Reported by Pylint.

Import outside toplevel (warnings)
Error

Line: 67 Column: 5

              

def soft_unicode(s: t.Any) -> str:
    import warnings

    warnings.warn(
        "'soft_unicode' has been renamed to 'soft_str'. The old name"
        " will be removed in MarkupSafe 2.1.",
        DeprecationWarning,

            

Reported by Pylint.

pipenv/vendor/yarg/exceptions.py
8 issues
Instance of 'HTTPError' has no 'status_code' member
Error

Line: 48 Column: 36

                      for key, val in kwargs.items():
            setattr(self, key, val)
        if hasattr(self, 'status_code'):
            setattr(self, 'errno', self.status_code)
        if hasattr(self, 'reason'):
            setattr(self, 'message', self.reason)

    def __str__(self):
        return self.__repr__()

            

Reported by Pylint.

Instance of 'HTTPError' has no 'reason' member
Error

Line: 50 Column: 38

                      if hasattr(self, 'status_code'):
            setattr(self, 'errno', self.status_code)
        if hasattr(self, 'reason'):
            setattr(self, 'message', self.reason)

    def __str__(self):
        return self.__repr__()

    def __repr__(self):

            

Reported by Pylint.

Instance of 'HTTPError' has no 'status_code' member
Error

Line: 57 Column: 49

              
    def __repr__(self):
        if hasattr(self, 'status_code') and hasattr(self, 'reason'):
            return "<HTTPError {0} {1}>".format(self.status_code, self.reason)
        return "<HTTPError>"

            

Reported by Pylint.

Instance of 'HTTPError' has no 'reason' member
Error

Line: 57 Column: 67

              
    def __repr__(self):
        if hasattr(self, 'status_code') and hasattr(self, 'reason'):
            return "<HTTPError {0} {1}>".format(self.status_code, self.reason)
        return "<HTTPError>"

            

Reported by Pylint.

__init__ method from base class 'HTTPError' is not called
Error

Line: 44 Column: 5

                  :member: status_code
    """

    def __init__(self, *args, **kwargs):
        for key, val in kwargs.items():
            setattr(self, key, val)
        if hasattr(self, 'status_code'):
            setattr(self, 'errno', self.status_code)
        if hasattr(self, 'reason'):

            

Reported by Pylint.

__init__ method from base class 'YargException' is not called
Error

Line: 44 Column: 5

                  :member: status_code
    """

    def __init__(self, *args, **kwargs):
        for key, val in kwargs.items():
            setattr(self, key, val)
        if hasattr(self, 'status_code'):
            setattr(self, 'errno', self.status_code)
        if hasattr(self, 'reason'):

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # -*- coding: utf-8 -*-

# (The MIT License)
#
# Copyright (c) 2014 Kura
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights

            

Reported by Pylint.

Missing class docstring
Error

Line: 29 Column: 1

              from requests.exceptions import HTTPError as RHTTPError


class YargException(Exception):
    pass


class HTTPError(YargException, RHTTPError):
    """

            

Reported by Pylint.

pipenv/vendor/jinja2/visitor.py
8 issues
Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              """
import typing as t

from .nodes import Node

if t.TYPE_CHECKING:
    import typing_extensions as te

    class VisitCallable(te.Protocol):

            

Reported by Pylint.

Unable to import 'typing_extensions'
Error

Line: 9 Column: 5

              from .nodes import Node

if t.TYPE_CHECKING:
    import typing_extensions as te

    class VisitCallable(te.Protocol):
        def __call__(self, node: Node, *args: t.Any, **kwargs: t.Any) -> t.Any:
            ...


            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 11 Column: 5

              if t.TYPE_CHECKING:
    import typing_extensions as te

    class VisitCallable(te.Protocol):
        def __call__(self, node: Node, *args: t.Any, **kwargs: t.Any) -> t.Any:
            ...


class NodeVisitor:

            

Reported by Pylint.

Missing class docstring
Error

Line: 11 Column: 5

              if t.TYPE_CHECKING:
    import typing_extensions as te

    class VisitCallable(te.Protocol):
        def __call__(self, node: Node, *args: t.Any, **kwargs: t.Any) -> t.Any:
            ...


class NodeVisitor:

            

Reported by Pylint.

Variable name "f" doesn't conform to snake_case naming style
Error

Line: 37 Column: 9

              
    def visit(self, node: Node, *args: t.Any, **kwargs: t.Any) -> t.Any:
        """Visit a node."""
        f = self.get_visitor(node)

        if f is not None:
            return f(node, *args, **kwargs)

        return self.generic_visit(node, *args, **kwargs)

            

Reported by Pylint.

Redefining argument with the local name 'node'
Error

Line: 46 Column: 13

              
    def generic_visit(self, node: Node, *args: t.Any, **kwargs: t.Any) -> t.Any:
        """Called if no explicit visitor function exists for a node."""
        for node in node.iter_child_nodes():
            self.visit(node, *args, **kwargs)


class NodeTransformer(NodeVisitor):
    """Walks the abstract syntax tree and allows modifications of nodes.

            

Reported by Pylint.

Unnecessary "elif" after "continue"
Error

Line: 68 Column: 25

                              for value in old_value:
                    if isinstance(value, Node):
                        value = self.visit(value, *args, **kwargs)
                        if value is None:
                            continue
                        elif not isinstance(value, Node):
                            new_values.extend(value)
                            continue
                    new_values.append(value)

            

Reported by Pylint.

Variable name "rv" doesn't conform to snake_case naming style
Error

Line: 87 Column: 9

                      """As transformers may return lists in some places this method
        can be used to enforce a list as return value.
        """
        rv = self.visit(node, *args, **kwargs)

        if not isinstance(rv, list):
            return [rv]

        return rv

            

Reported by Pylint.