i'm certainly in favor, as I already use flake8 in vim.<div><br></div><div>It's just an annoyance to me, but the only gotcha I've found is that I have no idea how to tell it to specifically ignore '_' being undefined (for i18n).<span></span><div>
<br>On Thursday, April 4, 2013, Monty Taylor  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey all!<br>
<br>
I was going to chat with folks about this at the summit, but it seems to<br>
be gaining momentum anyway, so there may not be a lot of pushback.<br>
<br>
Proposal:<br>
<br>
Replace pep8 and pyflakes and pylint and hacking.py in our testing with<br>
flake8<br>
<br>
Rationale:<br>
<br>
flake8 is the new pluggable hotness for this sort of thing. Out of the<br>
box it runs pep8 and pyflakes. The combo of those two winds up being<br>
very consistent and easy to deal with, so the extra goodness we get from<br>
pylint isn't really needed anymore. pyflakes regularly catches actual<br>
bugs for me, so rather than being just more style stuff, I'm pretty<br>
pleased with it as a useful bit of testing. It's also totally possible<br>
and easy to write pyflakes clean code.<br>
<br>
flake8 supports reading options from tox.ini, which we already have in<br>
our trees - even if you aren't using tox to run it. So we can set<br>
project options easily (like ignore=E125) and just running flake8 from<br>
the command line - or inside of vim/emacs - will work with the right<br>
settings.<br>
<br>
pyflakes issues show up prefixed by "F" and each one can be ignored now<br>
just like with pep8.<br>
<br>
flake8 also supports configurable additions to builtins, which lets us<br>
deal with the normal pyflakes issue with how we do gettext.<br>
<br>
I've also taken hacking.py from nova and turned it into a flake8 plugin,<br>
which means we can use that without copying it around. The hacking<br>
plugin is in openstack-dev/hacking in gerrit. If you install it, it will<br>
inject into the flake8 workflow and show its errors prefixed with "H".<br>
<br>
If there is a massive trainwreck on a line and pyflakes/hacking just<br>
can't deal with reality, you can add a # noqa tag to the line and it'll<br>
be skipped. We should probably be very limited in our usage of those.<br>
<br>
End result: no need for wrapper scripts around pep8, pyflakes or pylint.<br>
And a single, easy to deal with static-analysis check.<br>
<br>
Several of the infra projects have switched already, Maru just put up a<br>
quantum patch and I've got a ceilometer patch up for the switch. Patches<br>
for everyone else should be super easy.<br>
<br>
Thoughts?<br>
<br>
Monty<br>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'OpenStack-dev@lists.openstack.org')">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div></div><br><br>-- <br><div><br></div>-Dolph<br>