From 9c20ad85032f799720ac0808b37f9c37f46b5d9b Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Sat, 23 May 2015 15:22:30 -0700 Subject: [PATCH] Revise adding additional checks section of README * Remove reference to H302 since we removed it. * Add warning about tests that import random modules, we tried this for a long time and it caused tons of pain, so make sure we don't repeat history. Change-Id: Iced74c4d7a6b19a53f5f6ce9f66c20e9020db04c --- README.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 0bf982b..f41a09a 100644 --- a/README.rst +++ b/README.rst @@ -60,9 +60,9 @@ Each check is a pep8 plugin so read The focus of new or changed rules should be to do one of the following -- Substantially increase the reviewability of the code (eg: H301,2,3 +- Substantially increase the reviewability of the code (eg: H301, H303) as they make it easy to understand where symbols come from) -- Catch a common programming error that may arrise in the future (H201) +- Catch a common programming error that may arise in the future (H201) - Prevent a situation that would 100% of the time be -1ed by developers (H903) @@ -75,16 +75,19 @@ branch, it can be added as off by default. Requirements ------------ -- The check must already have community support. We do not want to dictate style, only enforce it. +- The check must already have community support. We do not want to dictate + style, only enforce it. - The canonical source of the OpenStack Style Guidelines is `HACKING.rst `_, and hacking just enforces them; so when adding a new check, it must be in ``HACKING.rst`` - False negatives are ok, but false positives are not - Cannot be project specific, project specific checks should be `Local Checks`_ -- Docstring tests +- Include extensive tests - Registered as entry_points in `setup.cfg `_ - Error code must be in the relevant ``Hxxx`` group +- The check should not attempt to import modules from the code being checked. + Importing random modules, has caused all kinds of trouble for us in the past. Local Checks