Skip to content

Commit

Permalink
Refactor: Resolve Flake8 F401 and F403 and F405
Browse files Browse the repository at this point in the history
It's bad practice to use * imports (F405) since the methods or
variables being imported could be undefined. Explicitly importing
makes this more clear. Also F403 violation makes it difficult to
detect undefined names.

Additionally F401 violation to allow an indirect module import makes
things harder to debug. It's better to be explicit.

https://www.flake8rules.com/rules/F401.html
https://www.flake8rules.com/rules/F403.html
https://www.flake8rules.com/rules/F405.html

Change-Id: Ib938f865d3ac6456216a119c830d3b013932bf88
Signed-off-by: Thanh Ha <[email protected]>
  • Loading branch information
zxiiro committed Oct 6, 2021
1 parent b5a0022 commit 3db2757
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 22 deletions.
10 changes: 6 additions & 4 deletions lftools/cli/nexus2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
__author__ = "DW Talton"


import click

from lftools.api.endpoints import nexus2

from .privilege import *
from .repository import *
from .role import *
from .user import *
from .privilege import privilege
from .repository import repo
from .role import role
from .user import user


@click.group(name="nexus2")
Expand Down
20 changes: 12 additions & 8 deletions lftools/cli/nexus3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@

__author__ = "DW Talton"

from .asset import *
from .privilege import *
from .repository import *
from .role import *
from .script import *
from .tag import *
from .task import *
from .user import *
import click

from lftools.api.endpoints import nexus3

from .asset import asset
from .privilege import privilege
from .repository import repository
from .role import role
from .script import script
from .tag import tag
from .task import task
from .user import user


@click.group(name="nexus3")
Expand Down
2 changes: 0 additions & 2 deletions lftools/cli/nexus3/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

import click

from lftools.api.endpoints import nexus3 # noqa: F401

log = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions lftools/cli/nexus3/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
import click
from tabulate import tabulate

from lftools.api.endpoints import nexus3 # noqa: F401

log = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions lftools/cli/nexus3/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

import click

from lftools.api.endpoints import nexus3 # noqa: F401

log = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions lftools/cli/nexus3/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import click
from tabulate import tabulate

from lftools.api.endpoints import nexus3 # noqa: F401

log = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions lftools/cli/nexus3/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import click
from tabulate import tabulate

from lftools.api.endpoints import nexus3 # noqa: F401

log = logging.getLogger(__name__)


Expand Down

0 comments on commit 3db2757

Please sign in to comment.