neutron-lib/HACKING.rst
Takashi NATSUME eb32fd4fbd Add a hacking rule for string interpolation at logging
String interpolation should be delayed to be handled
by the logging code, rather than being done at the point of
the logging call. So add the following hacking rule for it.

- [N536] String interpolation should be delayed at logging calls.

We need this to ensure that all projects using the neutron-lib
hacking rules still have enforcement of the log policies
of the project.

See the oslo i18n guideline.

* http://docs.openstack.org/developer/oslo.i18n/guidelines.html

Change-Id: I901dcbfbd53d5d19db651473d2891bc8e8a59710
Related-Bug: #1596829
2016-08-15 09:53:28 +09:00

1.1 KiB

neutron-lib Style Commandments

Neutron Library Specific Commandments

  • [N521] Validate that jsonutils module is used instead of json
  • [N523] DEPRECATED. Enforce namespace-less imports for oslo libraries
  • [N524] Prevent use of deprecated contextlib.nested.
  • [N525] Python 3: Do not use xrange.
  • [N526] Python 3: do not use basestring.
  • [N527] Python 3: do not use dict.iteritems.
  • [N529] Method's default argument shouldn't be mutable
  • [N530] No importing of neutron; should be ignored in neutron itself
  • [N531] Validate that LOG messages, except debug ones, have translations
  • [N532] Validate that LOG.warning is used instead of LOG.warn. The latter is deprecated.
  • [N533] Validate that debug level logs are not translated
  • [N534] Exception messages should be translated
  • [N535] Usage of Python eventlet module not allowed
  • [N536] String interpolation should be delayed at logging calls.