2015-06-17 04:00:33 +00:00
|
|
|
Magnum Style Commandments
|
2015-02-26 23:03:42 +00:00
|
|
|
=========================
|
2014-09-09 12:04:53 +00:00
|
|
|
|
2015-06-16 08:34:05 +00:00
|
|
|
- Step 1: Read the OpenStack Style Commandments
|
|
|
|
http://docs.openstack.org/developer/hacking/
|
|
|
|
- Step 2: Read on
|
|
|
|
|
2015-06-17 04:00:33 +00:00
|
|
|
Magnum Specific Commandments
|
2015-09-16 15:52:43 +00:00
|
|
|
----------------------------
|
2015-06-16 08:34:05 +00:00
|
|
|
|
2016-01-29 06:29:24 +00:00
|
|
|
- [M302] Change assertEqual(A is not None) by optimal assert like
|
|
|
|
assertIsNotNone(A).
|
2015-11-05 04:44:59 +00:00
|
|
|
- [M310] timeutils.utcnow() wrapper must be used instead of direct calls to
|
|
|
|
datetime.datetime.utcnow() to make it easy to override its return value.
|
2016-01-29 06:29:24 +00:00
|
|
|
- [M316] Change assertTrue(isinstance(A, B)) by optimal assert like
|
|
|
|
assertIsInstance(A, B).
|
2015-10-26 07:05:14 +00:00
|
|
|
- [M318] Change assertEqual(A, None) or assertEqual(None, A) by optimal assert
|
|
|
|
like assertIsNone(A)
|
2016-07-19 06:10:41 +00:00
|
|
|
- [M319] Change assertNotEqual(A, None) or assertNotEqual(None, A)
|
|
|
|
by optimal assert like assertIsNotNone(A)
|
2015-07-03 22:09:28 +00:00
|
|
|
- [M322] Method's default argument shouldn't be mutable.
|
2015-10-26 06:55:56 +00:00
|
|
|
- [M323] Change assertEqual(True, A) or assertEqual(False, A) by optimal assert
|
|
|
|
like assertTrue(A) or assertFalse(A)
|
2015-12-03 13:16:07 +00:00
|
|
|
- [M336] Must use a dict comprehension instead of a dict constructor
|
|
|
|
with a sequence of key-value pairs.
|
2016-01-07 02:12:24 +00:00
|
|
|
- [M338] Use assertIn/NotIn(A, B) rather than assertEqual(A in B, True/False).
|
2016-03-12 20:24:31 +00:00
|
|
|
- [M339] Don't use xrange()
|
2016-07-29 17:38:22 +00:00
|
|
|
- [M340] Check for explicit import of the _ function.
|
2016-07-24 12:53:23 +00:00
|
|
|
- [M352] LOG.warn is deprecated. Enforce use of LOG.warning.
|