Skip to content

Commit

Permalink
chore: enable pylint check: "redefined-outer-name",
Browse files Browse the repository at this point in the history
Enable the pylint check "redefined-outer-name" and fix the errors
detected.
  • Loading branch information
JohnVillalovos committed Jun 4, 2022
1 parent 80aadaf commit 1324ce1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions gitlab/cli.py
Expand Up @@ -252,10 +252,10 @@ def _get_base_parser(add_help: bool = True) -> argparse.ArgumentParser:
def _get_parser() -> argparse.ArgumentParser:
# NOTE: We must delay import of gitlab.v4.cli until now or
# otherwise it will cause circular import errors
import gitlab.v4.cli
from gitlab.v4 import cli as v4_cli

parser = _get_base_parser()
return gitlab.v4.cli.extend_parser(parser)
return v4_cli.extend_parser(parser)


def _parse_value(v: Any) -> Any:
Expand Down
7 changes: 3 additions & 4 deletions gitlab/client.py
Expand Up @@ -119,9 +119,8 @@ def __init__(
raise ModuleNotFoundError(f"gitlab.v{self._api_version}.objects")
# NOTE: We must delay import of gitlab.v4.objects until now or
# otherwise it will cause circular import errors
import gitlab.v4.objects
from gitlab.v4 import objects

objects = gitlab.v4.objects
self._objects = objects
self.user: Optional[objects.CurrentUser] = None

Expand Down Expand Up @@ -214,9 +213,9 @@ def __setstate__(self, state: Dict[str, Any]) -> None:
) # pragma: no cover, dead code currently
# NOTE: We must delay import of gitlab.v4.objects until now or
# otherwise it will cause circular import errors
import gitlab.v4.objects
from gitlab.v4 import objects

self._objects = gitlab.v4.objects
self._objects = objects

@property
def url(self) -> str:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Expand Up @@ -59,7 +59,6 @@ disable = [
"missing-module-docstring",
"protected-access",
"redefined-builtin",
"redefined-outer-name",
"signature-differs",
"too-few-public-methods",
"too-many-ancestors",
Expand Down

0 comments on commit 1324ce1

Please sign in to comment.