Skip to content

Commit

Permalink
Updating HACKING to disallow the use of locals()
Browse files Browse the repository at this point in the history
Change-Id: I7bf2720bdb0456274dc81a73d91296dff0e3fced
  • Loading branch information
Thingee committed May 31, 2013
1 parent f30afa6 commit 6251df9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions HACKING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------
Expand Down

0 comments on commit 6251df9

Please sign in to comment.