diff --git a/HACKING.rst b/HACKING.rst index ca3a79b347..c14cc901d0 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -1,11 +1,11 @@ -magnum Style Commandments +Magnum Style Commandments ========================= - Step 1: Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/ - Step 2: Read on -magnum Specific Commandments +Magnum Specific Commandments --------------------------- -- [N301] policy.enforce_wsgi decorator must be the first decorator on a method. \ No newline at end of file +- [M301] policy.enforce_wsgi decorator must be the first decorator on a method. diff --git a/magnum/hacking/checks.py b/magnum/hacking/checks.py index 65d9dbd613..3de3b25bf0 100644 --- a/magnum/hacking/checks.py +++ b/magnum/hacking/checks.py @@ -20,10 +20,11 @@ Guidelines for writing new hacking checks - Use only for Magnum specific tests. OpenStack general tests should be submitted to the common 'hacking' module. - - Pick numbers in the range N3xx. Find the current test with + - Pick numbers in the range M3xx. Find the current test with the highest allocated number and then pick the next value. + If nova has an N3xx code for that test, use the same number. - Keep the test method code in the source file ordered based - on the N3xx value. + on the M3xx value. - List the new rule in the top level HACKING.rst file - Add test cases for each new rule to magnum/tests/unit/test_hacking.py @@ -36,7 +37,7 @@ decorator_re = re.compile(r"@.*") def check_policy_enforce_decorator(logical_line, previous_logical, blank_before, filename): - msg = ("N301: the policy.enforce_wsgi decorator must be the " + msg = ("M301: the policy.enforce_wsgi decorator must be the " "first decorator on a method.") if (blank_before == 0 and re.match(enforce_re, logical_line) and re.match(decorator_re, previous_logical)): diff --git a/magnum/tests/unit/test_hacking.py b/magnum/tests/unit/test_hacking.py index bcd65e61e0..b0b3d7d593 100644 --- a/magnum/tests/unit/test_hacking.py +++ b/magnum/tests/unit/test_hacking.py @@ -1,4 +1,4 @@ -# Copyright 2915 Intel, Inc. +# Copyright 2015 Intel, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain @@ -82,4 +82,4 @@ class HackingTestCase(base.TestCase): pass """ self._assert_has_errors(code, checks.check_policy_enforce_decorator, - expected_errors=[(2, 0, "N301")]) + expected_errors=[(2, 0, "M301")])