Remove N331 hacking rules

Per discussion in
https://review.openstack.org/#/c/145506/
https://review.openstack.org/#/c/135888/
there is no need to check whether warn or warning usage since
py3 support both. So according to the suggestion, this patch
removes N331 check.

Change-Id: I20a62c1d1e953f52a63565b8446f1561d178d5af
This commit is contained in:
jichenjc 2015-01-26 07:32:37 +08:00
parent 47364ec0ce
commit 8510d3aaee
3 changed files with 0 additions and 9 deletions

View File

@ -40,7 +40,6 @@ Nova Specific Commandments
- [N328] Validate that LOG.info messages use _LI.
- [N329] Validate that LOG.exception messages use _LE.
- [N330] Validate that LOG.warning messages use _LW.
- [N331] Change LOG.warn on LOG.warning.
- [N332] Check that the api_version decorator is the first decorator on a method
- [N333] Check for oslo library imports use the non-namespaced packages
- [N334] Change assertTrue/False(A in/not in B, message) to the more specific

View File

@ -348,9 +348,6 @@ def validate_log_translations(logical_line, physical_line, filename):
msg = "N330: LOG.warning messages require translations `_LW()`!"
if log_translation_LW.match(logical_line):
yield (0, msg)
msg = "N331: Use LOG.warning due to compatibility with py3"
if log_warn.match(logical_line):
yield (0, msg)
msg = "N321: Log messages require translations!"
if log_translation.match(logical_line):
yield (0, msg)

View File

@ -239,11 +239,6 @@ class HackingTestCase(test.NoDBTestCase):
len(list(
checks.validate_log_translations(ok, ok, 'f'))))
def test_log_translations_warning_instead_warn(self):
warn = "LOG.warn('qwe')"
self.assertEqual(
1, len(list(checks.validate_log_translations(warn, warn, 'f'))))
def test_no_mutable_default_args(self):
self.assertEqual(1, len(list(checks.no_mutable_default_args(
" def fake_suds_context(calls={}):"))))