]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Improve regex for _ import hacking check
authorJay S. Bryant <jsbryant@us.ibm.com>
Sat, 2 Aug 2014 23:06:38 +0000 (18:06 -0500)
committerJay S. Bryant <jsbryant@us.ibm.com>
Thu, 7 Aug 2014 20:55:58 +0000 (15:55 -0500)
commit53474391420cdd8c02967a862b0218b37c84b561
tree9c26a4ebb73a180a047f594df308fe91c9556ea7
parent7a97f5c58a8b2acfa179438885ff88902d8852d2
Improve regex for _ import hacking check

Commit 3e2b1117 added a check to make sure that the _
function was being explicitly imported so that translation would
work properly.

I have discovered that those regexes/code would not work in some cases.
Particularly if the import line imported multiple things from
gettextutils or i18n.  Also the check being used to find lines using
the _ function was not right.

This commit fixes the issues and adds appropriate tests.  It also
adds the hacking check to HACKING.rst which should have been done the
first time around.

Change-Id: I7227bb0051836e537bff2f0f97662c06452d5af6
HACKING.rst
cinder/hacking/checks.py
cinder/tests/test_hacking.py