<div dir="ltr"><div><div><div>Hi, Dirk<br><br></div>If a line just with single print (which means a function name) does nothing, I think it should be removed,<br></div><br></div>print$ cannot be detected by "\bprint\s+[^\(]"<br>
<br>>>> import re<br>>>> print re.search(r"\bprint\s+[^\(]", "print")<br>None<br>>>> print re.search(r"\bprint(?:$|\s+[^\(])", "print")<br><_sre.SRE_Match object at 0xb6c2bfa8><br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 23, 2014 at 7:06 PM, Dirk Müller <span dir="ltr"><<a href="mailto:dirk@dmllr.de" target="_blank">dirk@dmllr.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Zhi Qiang,<br>
<div class="im"><br>
> for i.e. the hacking rule h233 in hacking looks not so robust,<br>
> <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>
> it cannot detect<br>
><br>
> \bprint$<br>
> \bprint >>>xxx, (\s+<br>
<br>
</div>It currently detects both as a violation of the rule, which is IMHO<br>
correct. Please note that the behavior of<br>
<br>
print<br>
<br>
depends on if its an operator (then it prints a newline) and a<br>
function (then it does nothing)<br>
<br>
<br>
Greetings,<br>
Dirk<br>
<div class="HOEnZb"><div class="h5"><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>
</div></div></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>