mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Enable wildcard import pylint (#35786)
* Wildcard imports should be taken care of. Enable the pylint check for them * Remove wildcard import code-smell test as we're now checking via pylint * Add unused-wildcard-import as ignored in our compat code. These three files use wildcard imports so that they can export symbols in a compatible location. The real code lives elsewhere. So disable the pylint tests for the relevant sections of code.
This commit is contained in:
@@ -32,11 +32,11 @@ import sys
|
||||
try:
|
||||
# Allow wildcard import because we really do want to import all of mock's
|
||||
# symbols into this compat shim
|
||||
# pylint: disable=wildcard-import
|
||||
# pylint: disable=wildcard-import,unused-wildcard-import
|
||||
from unittest.mock import *
|
||||
except ImportError:
|
||||
# Python 2
|
||||
# pylint: disable=wildcard-import
|
||||
# pylint: disable=wildcard-import,unused-wildcard-import
|
||||
try:
|
||||
from mock import *
|
||||
except ImportError:
|
||||
|
||||
@@ -27,7 +27,7 @@ import sys
|
||||
|
||||
# Allow wildcard import because we really do want to import all of
|
||||
# unittests's symbols into this compat shim
|
||||
# pylint: disable=wildcard-import
|
||||
# pylint: disable=wildcard-import,unused-wildcard-import
|
||||
if sys.version_info < (2, 7):
|
||||
try:
|
||||
# Need unittest2 on python2.6
|
||||
|
||||
@@ -20,7 +20,7 @@ from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
# This is backwards compat. unsafe_proxy was moved to avoid circular imports.
|
||||
from ansible.utils.unsafe_proxy import * # pylint: disable=wildcard-import
|
||||
from ansible.utils.unsafe_proxy import * # pylint: disable=wildcard-import,unused-wildcard-import
|
||||
|
||||
try:
|
||||
from __main__ import display
|
||||
|
||||
Reference in New Issue
Block a user