From a74b0447193188077f5a1cb6e9f4aa20e00ef734 Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Wed, 17 Dec 2014 13:45:12 -0800 Subject: [PATCH] Add docstring to is_import_exception Clarify what is_import_exception does. Leave the name as is_import_exception and no is_import_whitelisted because import-exceptions is part of the API for hacking (used in the hacking section of tox.ini). Change-Id: Ib36d84078ecfcdbcb62137b40ab7426738e56a45 --- hacking/core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hacking/core.py b/hacking/core.py index 2e513439..e43db209 100644 --- a/hacking/core.py +++ b/hacking/core.py @@ -74,6 +74,10 @@ IMPORT_EXCEPTIONS += DEFAULT_IMPORT_EXCEPTIONS def is_import_exception(mod): + """Check module name to see if import has been whitelisted. + + Import based rules should not run on any whitelisted module + """ return (mod in IMPORT_EXCEPTIONS or any(mod.startswith(m + '.') for m in IMPORT_EXCEPTIONS))