[openstack-dev] coding standards question

Greg Hill greg.hill at RACKSPACE.COM
Tue Jan 7 14:26:47 UTC 2014


I got a -1 on a review for a standards violation that isn't caught by the automated checks, so I was wondering why the automated check doesn't catch it.  The violation was:

from X import Y, Z

According to the coding standards page on the openstack wiki, the coding standards are PEP8 (they just link to the PEP8 docs): https://wiki.openstack.org/wiki/CodingStandards and PEP8 explicitly says this format is allowed.

It was pointed out that there's an additional wiki page I had missed, http://docs.openstack.org/developer/hacking/ which specifies this rule.  So now that I see it is a rule, it comes back to my original question, why is it not enforced by the checker?  Apparently there's not a flake8 rule for this either https://flake8.readthedocs.org/en/2.0/warnings.html

So, two questions:

1. Is this really the rule or just a vaguely worded repeat of the PEP8 rule about import X, Y?
2. If it is the rule, what's involved in getting the pep8 tests to check for it?

My own personal frustration aside, this would be helpful for other newcomers I imagine.  We have some pretty rigid and extensive coding standards, so its not reasonable to expect new contributors to remember them all.  It's also much nicer to have an automated tool tell you you violated some coding standard than to think you were ok and then have your code rejected 2 weeks later because of it.

Thanks,
Greg

P.S. I can fix the wiki to point to the right page after the discussion.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140107/61ebf05f/attachment.html>


More information about the OpenStack-dev mailing list