Skip to content

Commit 1324ce1

Browse files
chore: enable pylint check: "redefined-outer-name",
Enable the pylint check "redefined-outer-name" and fix the errors detected.
1 parent 80aadaf commit 1324ce1

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

gitlab/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,10 @@ def _get_base_parser(add_help: bool = True) -> argparse.ArgumentParser:
252252
def _get_parser() -> argparse.ArgumentParser:
253253
# NOTE: We must delay import of gitlab.v4.cli until now or
254254
# otherwise it will cause circular import errors
255-
import gitlab.v4.cli
255+
from gitlab.v4 import cli as v4_cli
256256

257257
parser = _get_base_parser()
258-
return gitlab.v4.cli.extend_parser(parser)
258+
return v4_cli.extend_parser(parser)
259259

260260

261261
def _parse_value(v: Any) -> Any:

gitlab/client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,8 @@ def __init__(
119119
raise ModuleNotFoundError(f"gitlab.v{self._api_version}.objects")
120120
# NOTE: We must delay import of gitlab.v4.objects until now or
121121
# otherwise it will cause circular import errors
122-
import gitlab.v4.objects
122+
from gitlab.v4 import objects
123123

124-
objects = gitlab.v4.objects
125124
self._objects = objects
126125
self.user: Optional[objects.CurrentUser] = None
127126

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

219-
self._objects = gitlab.v4.objects
218+
self._objects = objects
220219

221220
@property
222221
def url(self) -> str:

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ disable = [
5959
"missing-module-docstring",
6060
"protected-access",
6161
"redefined-builtin",
62-
"redefined-outer-name",
6362
"signature-differs",
6463
"too-few-public-methods",
6564
"too-many-ancestors",

0 commit comments

Comments
 (0)