Ironic code ignores all E12* pep8 errors

Bug #1421522 reported by John L. Villalovos
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Wishlist
Sam Betts

Bug Description

Ironic pep8 tests in fact only run flake8. pep8 reports many issues with Ironic code.

Running the following on Ironic code base:
$ pep8 --version
1.5.7
$ pep8 | wc
   1009 8071 101963
$ pep8 | head
./ironic/conductor/manager.py:86:9: E126 continuation line over-indented for hanging indent
./ironic/conductor/manager.py:110:20: E128 continuation line under-indented for visual indent
./ironic/conductor/manager.py:111:20: E128 continuation line under-indented for visual indent
./ironic/conductor/manager.py:136:20: E128 continuation line under-indented for visual indent
./ironic/conductor/manager.py:137:20: E128 continuation line under-indented for visual indent
./ironic/conductor/manager.py:144:20: E128 continuation line under-indented for visual indent
./ironic/conductor/manager.py:145:20: E128 continuation line under-indented for visual indent
./ironic/conductor/manager.py:148:25: E124 closing bracket does not match visual indentation
./ironic/conductor/manager.py:209:33: E126 continuation line over-indented for hanging indent
./ironic/conductor/manager.py:254:50: E127 continuation line over-indented for visual indent
$ pep8 | tail
./ironic/drivers/modules/ilo/management.py:35:32: E127 continuation line over-indented for visual indent
./ironic/drivers/modules/ilo/management.py:36:30: E124 closing bracket does not match visual indentation
./ironic/drivers/modules/ilo/management.py:148:18: E128 continuation line under-indented for visual indent
./ironic/drivers/modules/ilo/power.py:153:17: E128 continuation line under-indented for visual indent
./ironic/drivers/modules/ilo/power.py:159:20: E127 continuation line over-indented for visual indent
./ironic/drivers/modules/ilo/power.py:160:22: E127 continuation line over-indented for visual indent
./ironic/drivers/modules/ilo/power.py:172:21: E127 continuation line over-indented for visual indent
./doc/source/conf.py:63:1: E265 block comment should start with '# '
./doc/source/conf.py:64:1: E265 block comment should start with '# '
./doc/source/conf.py:65:1: E265 block comment should start with '# '

I will discuss this with Ironic team and see if they are amenable to a patch to fix these issues and then adding 'pep8' to the testing to prevent future issues.

Revision history for this message
Dmitry Tantsur (divius) wrote :

Hi! I suspect that it's due to use hacking and some rules being disabled/modified. I think it should be fixed (if ever) on hacking level, not per-project. But please feel free to seek other's opinions.

Changed in ironic:
status: New → Opinion
Revision history for this message
John L. Villalovos (happycamp) wrote :

I figured out it is because the project's tox.ini file.

It ignores 'E12' which really means E12[0-9].

I have posted an initial patch to add granularity:
https://review.openstack.org/157171

Then future work would be to remove ignores and fix errors.

Revision history for this message
Dmitry Tantsur (divius) wrote :

Thanks, I didn't realize that we're ignoring some many errors.

summary: - Ironic code appears to not be PEP8 compliant
+ Ironic code ignores all E12* pep8 errors
Changed in ironic:
status: Opinion → Triaged
importance: Undecided → Wishlist
Sam Betts (sambetts)
Changed in ironic:
assignee: nobody → Sam Betts (sambetts)
Revision history for this message
John L. Villalovos (happycamp) wrote :

I have added checking for many of the E12* errors now.

The remaining ones left will require big changes to the code base. Need to work with the team to see if they desire to bring the code into compliance.

E129 patch was abandoned as there wasn't consensus for it:
https://review.openstack.org/173427

So that leaves:
E123,E126,E127,E128

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

Fix proposed to branch: master
Review: https://review.openstack.org/186021

Changed in ironic:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/186450

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/186451

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/186452

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/186453

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/186454

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/186455

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/186456

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/186457

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/186458

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on ironic (master)

Change abandoned by Sam Betts (<email address hidden>) on branch: master
Review: https://review.openstack.org/186451
Reason: Commit combined with the others

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Sam Betts (<email address hidden>) on branch: master
Review: https://review.openstack.org/186452
Reason: Commit combined with the others

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Sam Betts (<email address hidden>) on branch: master
Review: https://review.openstack.org/186453
Reason: Commit combined with the others

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Sam Betts (<email address hidden>) on branch: master
Review: https://review.openstack.org/186454
Reason: Commit combined with the others

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Sam Betts (<email address hidden>) on branch: master
Review: https://review.openstack.org/186455
Reason: Commit combined with the others

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Sam Betts (<email address hidden>) on branch: master
Review: https://review.openstack.org/186456
Reason: Commit combined with the others

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Sam Betts (<email address hidden>) on branch: master
Review: https://review.openstack.org/186457
Reason: Commit combined with the others

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Sam Betts (<email address hidden>) on branch: master
Review: https://review.openstack.org/186458
Reason: Commit combined with the others

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Sam Betts (<email address hidden>) on branch: master
Review: https://review.openstack.org/186021
Reason: Commit combined with the others

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.openstack.org/186450
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=8c07c4fda3e6a86a40aa00759652b99acbd73331
Submitter: Jenkins
Branch: master

commit 8c07c4fda3e6a86a40aa00759652b99acbd73331
Author: Sam Betts <email address hidden>
Date: Thu May 28 16:54:36 2015 +0100

    Enforce flake8 E123/6/7/8 in ironic

    This patch enforces the rules E123, E126, E127, and E128 in the ironic
    code base:

    E123 - closing bracket does not match indentation of opening
    bracket’s line
    E126 - continuation line over-indented for hanging indent
    E127 - continuation line over-indented for visual indent
    E128 - continuation line under-indented for visual indent

    This fixes any parts of the current code which fails these rules and
    removes these rules from the tox.ini flake8 ignore list.

    Change-Id: Ia96582b5e9abc088d6c1694afc93c59be4a4065c
    Closes-Bug: 1421522

Changed in ironic:
status: In Progress → Fix Committed
Changed in ironic:
milestone: none → 4.0.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.