hacking: Specify white list rules in noqa explicity

If 'noqa' is specified all hacking checks are disabled.
It is better to ignore specific rules explicitly rather than
ignoring all. The recent flake8 supports this [1].

[1] http://flake8.pycqa.org/en/stable/user/ignoring-errors.html

Change-Id: I4ea55a0b22f8d6c975dcc074403efe2565078e22
This commit is contained in:
Shu Muto 2017-06-22 14:08:12 +09:00
parent 6bcdf8efb1
commit 64a6b4e8be
7 changed files with 7 additions and 29 deletions

View File

@ -15,7 +15,7 @@
import os import os
import sys import sys
from django.core.management import execute_from_command_line # noqa from django.core.management import execute_from_command_line
if __name__ == "__main__": if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", os.environ.setdefault("DJANGO_SETTINGS_MODULE",

View File

@ -20,7 +20,7 @@
import os import os
import sys import sys
import install_venv_common as install_venv # noqa import install_venv_common as install_venv
def print_help(venv, root): def print_help(venv, root):

22
tox.ini
View File

@ -60,25 +60,3 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen
exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py,*/local/*,*/test/test_plugins/*,.ropeproject,node_modules exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py,*/local/*,*/test/test_plugins/*,.ropeproject,node_modules
max-complexity = 20 max-complexity = 20
[hacking]
import_exceptions = collections.defaultdict,
django.conf.settings,
django.conf.urls.include,
django.conf.urls.patterns,
django.conf.urls.url,
django.core.urlresolvers.reverse,
django.core.urlresolvers.reverse_lazy,
django.template.loader.render_to_string,
django.test.utils.override_settings,
django.utils.datastructures.SortedDict,
django.utils.encoding.force_text,
django.utils.html.conditional_escape,
django.utils.html.escape,
django.utils.http.urlencode,
django.utils.safestring.mark_safe,
django.utils.translation.npgettext_lazy,
django.utils.translation.pgettext_lazy,
django.utils.translation.ugettext_lazy,
django.utils.translation.ungettext_lazy,
operator.attrgetter,
StringIO.StringIO

View File

@ -27,4 +27,4 @@ shouldn't need to understand the finer details of APIs for
Keystone/Nova/Glance/Swift et. al. Keystone/Nova/Glance/Swift et. al.
""" """
from zaqar_ui.api import zaqar # noqa from zaqar_ui.api import zaqar # noqa: F401

View File

@ -21,4 +21,4 @@ in https://wiki.openstack.org/wiki/APIChangeGuidelines.
""" """
# import REST API modules here # import REST API modules here
from zaqar_ui.api.rest import zaqar # noqa from zaqar_ui.api.rest import zaqar # noqa: F401

View File

@ -13,4 +13,4 @@
# limitations under the License. # limitations under the License.
# Register the REST API URLs so they can be called from the JavaScript files # Register the REST API URLs so they can be called from the JavaScript files
import zaqar_ui.api.rest # noqa import zaqar_ui.api.rest # noqa: F401

View File

@ -11,8 +11,8 @@
# limitations under the License. # limitations under the License.
# Default to Horizons test settings to avoid any missing keys # Default to Horizons test settings to avoid any missing keys
from horizon.test.settings import * # noqa from horizon.test.settings import * # noqa: F403,H303
from openstack_dashboard.test.settings import * # noqa from openstack_dashboard.test.settings import * # noqa: F403,H303
# pop these keys to avoid log warnings about deprecation # pop these keys to avoid log warnings about deprecation
# update_dashboards will populate them anyway # update_dashboards will populate them anyway