From beae668caff82f4e10eeec0a49c81aebbff7db2d Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Tue, 11 Aug 2015 19:49:11 +0300 Subject: The --zope flag is deprecated and it is slated for removal in Pylint 1.6. The reason behind this removal is the fact that it's a specialized flag and there are solutions for the original problem: use --generated-members with the members that causes problems when using Zope or add AST transforms tailored to the zope project. Closes issue #570. --- pylint/checkers/typecheck.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'pylint/checkers') diff --git a/pylint/checkers/typecheck.py b/pylint/checkers/typecheck.py index c1f9d6f..fd98793 100644 --- a/pylint/checkers/typecheck.py +++ b/pylint/checkers/typecheck.py @@ -37,6 +37,13 @@ from pylint.checkers import BaseChecker from pylint.checkers.utils import ( is_super, check_messages, decorated_with_property, decorated_with, node_ignores_exception) +from pylint import utils + + +_ZOPE_DEPRECATED = ( + "This option is deprecated. Use generated-members instead." +) + def _unflatten(iterable): for elem in iterable: @@ -266,11 +273,9 @@ class should be ignored. A mixin class is detected if its name ends with \ 'can work with qualified names.'} ), - ('zope', - {'default' : False, 'type' : 'yn', 'metavar': '', - 'help' : 'When zope mode is activated, add a predefined set \ -of Zope acquired attributes to generated-members.'} - ), + ('zope', utils.deprecated_option(opt_type='yn', + help_msg=_ZOPE_DEPRECATED)), + ('generated-members', {'default' : (), 'type' : 'string', @@ -284,8 +289,6 @@ accessed. Python regular expressions are accepted.'} def open(self): # do this in open since config not fully initialized in __init__ self.generated_members = list(self.config.generated_members) - if self.config.zope: - self.generated_members.extend(('REQUEST', 'acl_users', 'aq_parent')) def visit_assattr(self, node): if isinstance(node.ass_type(), astroid.AugAssign): -- cgit v1.2.1