Skip to content

Commit

Permalink
Prohibit wildcard import in pylint (#8893)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiltsov-max authored Jan 30, 2025
1 parent 3bc92da commit 2ca90b0
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ disable=raw-checker-failed,
raise-missing-from,
raising-format-tuple,
wrong-exception-operation,
wildcard-import,
deprecated-module,
import-self,
preferred-module,
Expand Down Expand Up @@ -516,7 +515,8 @@ enable=singleton-comparison,
logging-unsupported-format,
logging-format-truncated,
logging-too-many-args,
logging-too-few-args
logging-too-few-args,
wildcard-import


[BASIC]
Expand Down
3 changes: 2 additions & 1 deletion cvat-sdk/cvat_sdk/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
#
# SPDX-License-Identifier: MIT

from cvat_sdk.api_client.models import * # pylint: disable=unused-import,redefined-builtin
# Reexport symbols for public SDK API
from cvat_sdk.api_client.models import * # pylint: disable=wildcard-import
4 changes: 2 additions & 2 deletions cvat/apps/engine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
#
# SPDX-License-Identifier: MIT


from .schema import * # force import of declared symbols
# Force execution of declared symbols
from .schema import * # pylint: disable=wildcard-import
3 changes: 2 additions & 1 deletion cvat/settings/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#
# SPDX-License-Identifier: MIT

from .base import *
# Inherit parent config
from .base import * # pylint: disable=wildcard-import

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
Expand Down
3 changes: 2 additions & 1 deletion cvat/settings/email_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#
# SPDX-License-Identifier: MIT

from cvat.settings.production import *
# Inherit parent config
from cvat.settings.production import * # pylint: disable=wildcard-import

# https://github.com/pennersr/django-allauth
ACCOUNT_AUTHENTICATION_METHOD = 'username_email'
Expand Down
3 changes: 2 additions & 1 deletion cvat/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#
# SPDX-License-Identifier: MIT

from .base import *
# Inherit parent config
from .base import * # pylint: disable=wildcard-import

DEBUG = False

Expand Down
3 changes: 2 additions & 1 deletion cvat/settings/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import tempfile

from .development import *
# Inherit parent config
from .development import * # pylint: disable=wildcard-import

DATABASES = {
'default': {
Expand Down
3 changes: 2 additions & 1 deletion cvat/settings/testing_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#
# SPDX-License-Identifier: MIT

from cvat.settings.production import *
# Inherit parent config
from cvat.settings.production import * # pylint: disable=wildcard-import

# We use MD5 password hasher instead of default PBKDF2 here to speed up REST API tests,
# because the current implementation of the tests requires authentication in each test case
Expand Down
3 changes: 2 additions & 1 deletion tests/python/cli/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
#
# SPDX-License-Identifier: MIT

from sdk.fixtures import * # pylint: disable=unused-import
# Force execution of fixture definitions
from sdk.fixtures import * # pylint: disable=wildcard-import
7 changes: 4 additions & 3 deletions tests/python/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: MIT

from shared.fixtures.data import *
from shared.fixtures.init import *
from shared.fixtures.util import *
# Force execution of fixture definitions
from shared.fixtures.data import * # pylint: disable=wildcard-import
from shared.fixtures.init import * # pylint: disable=wildcard-import
from shared.fixtures.util import * # pylint: disable=wildcard-import
3 changes: 2 additions & 1 deletion tests/python/sdk/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
#
# SPDX-License-Identifier: MIT

from .fixtures import *
# Force execution of fixture definitions
from .fixtures import * # pylint: disable=wildcard-import

0 comments on commit 2ca90b0

Please sign in to comment.