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
1=== modified file 'Makefile'
2--- Makefile 2017-06-15 22:15:44 +0000
3+++ Makefile 2017-07-20 15:59:20 +0000
4@@ -69,9 +69,9 @@
5
6 lint: .venv .venv3
7 @echo Checking for Python syntax...
8- @.venv/bin/flake8 --ignore=E501,E402 $(PROJECT) $(TESTS) tools/ \
9+ @.venv/bin/flake8 --ignore=E501 $(PROJECT) $(TESTS) tools/ \
10 && echo Py2 OK
11- @.venv3/bin/flake8 --ignore=E501,E402 $(PROJECT) $(TESTS) tools/ \
12+ @.venv3/bin/flake8 --ignore=E501 $(PROJECT) $(TESTS) tools/ \
13 && echo Py3 OK
14
15 docs:
16
17=== modified file 'tests/contrib/hardening/test_templating.py'
18--- tests/contrib/hardening/test_templating.py 2017-03-20 10:28:01 +0000
19+++ tests/contrib/hardening/test_templating.py 2017-07-20 15:59:20 +0000
20@@ -19,7 +19,7 @@
21 from mock import call, patch
22 from unittest import TestCase
23
24-os.environ['JUJU_CHARM_DIR'] = '/tmp'
25+os.environ['JUJU_CHARM_DIR'] = '/tmp' # noqa: E402
26
27 from charmhelpers.contrib.hardening import templating
28 from charmhelpers.contrib.hardening import utils

Subscribers

People subscribed via source and target branches