Browse Source

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: Ieeb62e8d66e626ab2e6cd506ce3a9854c69d5643
changes/50/476350/2
Shu Muto 4 years ago
parent
commit
32aeaeffe6
  1. 2
      magnum_ui/api/rest/__init__.py
  2. 2
      magnum_ui/content/clusters/panel.py
  3. 4
      magnum_ui/test/settings.py
  4. 2
      manage.py
  5. 2
      tools/install_venv.py
  6. 22
      tox.ini

2
magnum_ui/api/rest/__init__.py

@ -13,4 +13,4 @@
# limitations under the License.
# Import REST modules here
from . import magnum # noqa
from . import magnum # noqa: F401

2
magnum_ui/content/clusters/panel.py

@ -18,7 +18,7 @@ import horizon
# DO NOT REMOVE
# This needs for register url of REST API.
# Dashboard plugins load REST API from here.
from magnum_ui.api.rest import magnum # noqa
from magnum_ui.api.rest import magnum # noqa: F401
class Clusters(horizon.Panel):

4
magnum_ui/test/settings.py

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

2
manage.py

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

2
tools/install_venv.py

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

22
tox.ini

@ -67,25 +67,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
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
Loading…
Cancel
Save