<div dir="ltr">understand, thank you very much<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 23, 2014 at 3:45 PM, Yuriy Taraday <span dir="ltr"><<a href="mailto:yorik.sar@gmail.com" target="_blank">yorik.sar@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello.<div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">On Thu, Jan 23, 2014 at 6:47 AM, ZhiQiang Fan <span dir="ltr"><<a href="mailto:aji.zqfan@gmail.com" target="_blank">aji.zqfan@gmail.com</a>></span> wrote: <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div><div><div><div><div>I noticed that in openstack-dev/hacking project, there is very little test code, is there any particular reason why it is in such situation?<br></div></div></div></div></div></div>
</blockquote>
<div><br></div></div><div>Yes, there is. Every rule have a docstring that not only provides examples of good and bad code but also is run as a doctest here: <a href="https://github.com/openstack-dev/hacking/blob/master/hacking/tests/test_doctest.py" target="_blank">https://github.com/openstack-dev/hacking/blob/master/hacking/tests/test_doctest.py</a></div>
<div class="im">
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><a href="https://github.com/openstack-dev/hacking/blob/master/hacking/core.py#L345" target="_blank">https://github.com/openstack-dev/hacking/blob/master/hacking/core.py#L345</a><br>
</div>
it cannot detect<br><br></div>\bprint$<br></div>\bprint >>>xxx, (\s+<br></div></div></div></blockquote><div><br></div></div><div>I'm not sure how can it not detect the second one since the regular expression used there to detect bad strings is "\bprint\s+[^\(]" and it catches "print >>>xxx, (" string.</div>
<div>The first one is a good catch though.</div><div class="im"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div>If I want to improve this rule, how can I verify that my change is good?<br></div></div></blockquote><div><br></div></div><div>Just change that regular expression as is needed and add a line to the docstring like these:</div>
<div>Okay: print()</div><div>H233: print</div><div><br></div><div>Happy coding!</div></div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><br><div>Kind regards, Yuriy.</div>
</font></span></div></div>
<br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto: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>
<br></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div>blog: <a href="http://zqfan.github.com" target="_blank">zqfan.github.com</a><br></div>git: <a href="http://github.com/zqfan" target="_blank">github.com/zqfan</a><br>
</div>
</div>