]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Updating HACKING to disallow the use of locals()
authorMike Perez <thingee@gmail.com>
Fri, 31 May 2013 08:11:13 +0000 (01:11 -0700)
committerMike Perez <thingee@gmail.com>
Fri, 31 May 2013 08:14:37 +0000 (01:14 -0700)
Change-Id: I7bf2720bdb0456274dc81a73d91296dff0e3fced

HACKING.rst

index eecb286b51fe6d0f2b9ea6f96162e1ee723b9b29..f124e009533e8db725ef33b0ccf2d992b9019dc1 100644 (file)
@@ -46,6 +46,15 @@ General
     if not (X in Y or X in Z):  # OKAY, still better than all those 'not's
         pass
 
+- Do not use locals(). Example::
+
+    LOG.debug(_("volume %(vol_name)s: creating size %(vol_size)sG") %
+              locals()) # BAD
+
+    LOG.debug(_("volume %(vol_name)s: creating size %(vol_size)sG") %
+              {'vol_name': vol_name,
+               'vol_size': vol_size}) # OKAY
+
 
 Imports
 -------