Hi, Dirk If a line just with single print (which means a function name) does nothing, I think it should be removed,
print$ cannot be detected by "\bprint\s+[^\(]" >>> import re >>> print re.search(r"\bprint\s+[^\(]", "print") None >>> print re.search(r"\bprint(?:$|\s+[^\(])", "print") <_sre.SRE_Match object at 0xb6c2bfa8> On Thu, Jan 23, 2014 at 7:06 PM, Dirk Müller <d...@dmllr.de> wrote: > Hi Zhi Qiang, > > > for i.e. the hacking rule h233 in hacking looks not so robust, > > > https://github.com/openstack-dev/hacking/blob/master/hacking/core.py#L345 > > it cannot detect > > > > \bprint$ > > \bprint >>>xxx, (\s+ > > It currently detects both as a violation of the rule, which is IMHO > correct. Please note that the behavior of > > print > > depends on if its an operator (then it prints a newline) and a > function (then it does nothing) > > > Greetings, > Dirk > > _______________________________________________ > OpenStack-dev mailing list > OpenStack-dev@lists.openstack.org > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev > -- blog: zqfan.github.com git: github.com/zqfan
_______________________________________________ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev