mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-08-13 06:25:00 -05:00
pylint_plugins: add forbidden import checker
Add new pylint AST checker plugin which implements a check for imports forbidden in IPA. Which imports are forbidden is configurable in pylintrc. Provide default forbidden import configuration and disable the check for existing forbidden imports in our code base. Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
committed by
Martin Basti
parent
6027a8111f
commit
5d489ac560
@@ -93,11 +93,13 @@ class PlatformService(object):
|
||||
"""
|
||||
|
||||
def __init__(self, service_name, api=None):
|
||||
# pylint: disable=ipa-forbidden-import
|
||||
import ipalib # FixMe: break import cycle
|
||||
# pylint: enable=ipa-forbidden-import
|
||||
self.service_name = service_name
|
||||
if api is not None:
|
||||
self.api = api
|
||||
else:
|
||||
import ipalib # FixMe: break import cycle
|
||||
self.api = ipalib.api
|
||||
warnings.warn(
|
||||
"{s.__class__.__name__}('{s.service_name}', api=None) "
|
||||
|
||||
Reference in New Issue
Block a user