Remove F403 and F405 exclusions

Importing from * is not a thing that should be done, as it masks
errors and makes code hard to understand. There are some copy-pasta
files that violate this. Mark them with noqa for now, because we don't
actually care about them.

Change-Id: I790f88c75ea546d83e347e42df0050ad36211936
This commit is contained in:
Monty Taylor
2020-02-27 09:02:46 -06:00
parent 15f7f7fc7b
commit 2527faec28
3 changed files with 7 additions and 7 deletions

View File

@@ -33,12 +33,12 @@ try:
# Allow wildcard import because we really do want to import all of mock's
# symbols into this compat shim
# pylint: disable=wildcard-import,unused-wildcard-import
from unittest.mock import *
from unittest.mock import * # noqa
except ImportError:
# Python 2
# pylint: disable=wildcard-import,unused-wildcard-import
try:
from mock import *
from mock import * # noqa
except ImportError:
print('You need the mock library installed on python2.x to run tests')
@@ -102,9 +102,9 @@ if sys.version_info >= (3,) and sys.version_info < (3, 4, 4):
file_spec = list(set(dir(_io.TextIOWrapper)).union(set(dir(_io.BytesIO))))
if mock is None:
mock = MagicMock(name='open', spec=open)
mock = MagicMock(name='open', spec=open) # noqa
handle = MagicMock(spec=file_spec)
handle = MagicMock(spec=file_spec) # noqa
handle.__enter__.return_value = handle
_data = _iterate_read_data(read_data)

View File

@@ -31,8 +31,8 @@ import sys
if sys.version_info < (2, 7):
try:
# Need unittest2 on python2.6
from unittest2 import *
from unittest2 import * # noqa
except ImportError:
print('You need unittest2 installed on python2.6.x to run tests')
else:
from unittest import *
from unittest import * # noqa

View File

@@ -51,7 +51,7 @@ commands = {posargs}
# H4 are rules for docstrings. Maybe we should clean them?
# E501,E402,H301,H236,F401,E128 are ignored so we can import the existing
# modules unchanged and then clean them in subsequent patches.
ignore = W503,H4,E501,E402,H301,H236,F401,E128,W504,F403,F405
ignore = W503,H4,E501,E402,H301,H236,F401,E128,W504
show-source = True
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,ansible_collections