Merge lp:~ajkavanagh/charm-helpers/remove-e402-ignore into lp:charm-helpers

Proposed by Alex Kavanagh
Status: Merged
Merged at revision: 767
Proposed branch: lp:~ajkavanagh/charm-helpers/remove-e402-ignore
Merge into: lp:charm-helpers
Diff against target: 28 lines (+3/-3)
2 files modified
Makefile (+2/-2)
tests/contrib/hardening/test_templating.py (+1/-1)
To merge this branch: bzr merge lp:~ajkavanagh/charm-helpers/remove-e402-ignore
Reviewer Review Type Date Requested Status
Stuart Bishop (community) Approve
Review via email: mp+327806@code.launchpad.net

Description of the change

Remove E402 ingore for pep8 to improve code checking

The flake8 pep8 tests used an --ignore E402 which is about
not having all the imports before 'code'. This is a known
code QA issue, and so this patch removes the ignore. One
test module needed to be patched with a #noqa, but that's
because the files imported adjusted their behaviour based
on the changed line for the tests

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) wrote :

I guess we have less import magic now, which is a win.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile'
--- Makefile 2017-06-15 22:15:44 +0000
+++ Makefile 2017-07-20 15:59:20 +0000
@@ -69,9 +69,9 @@
6969
70lint: .venv .venv370lint: .venv .venv3
71 @echo Checking for Python syntax...71 @echo Checking for Python syntax...
72 @.venv/bin/flake8 --ignore=E501,E402 $(PROJECT) $(TESTS) tools/ \72 @.venv/bin/flake8 --ignore=E501 $(PROJECT) $(TESTS) tools/ \
73 && echo Py2 OK73 && echo Py2 OK
74 @.venv3/bin/flake8 --ignore=E501,E402 $(PROJECT) $(TESTS) tools/ \74 @.venv3/bin/flake8 --ignore=E501 $(PROJECT) $(TESTS) tools/ \
75 && echo Py3 OK75 && echo Py3 OK
7676
77docs:77docs:
7878
=== modified file 'tests/contrib/hardening/test_templating.py'
--- tests/contrib/hardening/test_templating.py 2017-03-20 10:28:01 +0000
+++ tests/contrib/hardening/test_templating.py 2017-07-20 15:59:20 +0000
@@ -19,7 +19,7 @@
19from mock import call, patch19from mock import call, patch
20from unittest import TestCase20from unittest import TestCase
2121
22os.environ['JUJU_CHARM_DIR'] = '/tmp'22os.environ['JUJU_CHARM_DIR'] = '/tmp' # noqa: E402
2323
24from charmhelpers.contrib.hardening import templating24from charmhelpers.contrib.hardening import templating
25from charmhelpers.contrib.hardening import utils25from charmhelpers.contrib.hardening import utils

Subscribers

People subscribed via source and target branches