summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2016-11-11 16:46:43 +0000
committerIan Cordasco <graffatcolmingov@gmail.com>2016-11-11 16:46:43 +0000
commit22233b6b4fc6f36ed1757b31f7306192fa8d6e05 (patch)
tree8e67f1bcbe1c7c9761dc98051935cde805fd82f8 /src
parent040ef672a4e67674a837632ace9168ac6273f3f5 (diff)
parent1dfd6bae771619386f7251c3c8281cbb81486b95 (diff)
downloadflake8-22233b6b4fc6f36ed1757b31f7306192fa8d6e05.tar.gz
Merge branch 'bug/239' into 'master'
Actually remove enabled extensions from ignore list When we enable a plugin (when it's provided in the --enable-extensions) plugin, we need to remove it both from the extended default ignore list and the plain ignore list. Closes #239 cc @warsaw See merge request !138
Diffstat (limited to 'src')
-rw-r--r--src/flake8/plugins/manager.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/flake8/plugins/manager.py b/src/flake8/plugins/manager.py
index a5f1c3b..52b658c 100644
--- a/src/flake8/plugins/manager.py
+++ b/src/flake8/plugins/manager.py
@@ -182,10 +182,17 @@ class Plugin(object):
LOG.critical(str(failed_to_load))
raise failed_to_load
- def enable(self, optmanager):
+ def enable(self, optmanager, options=None):
"""Remove plugin name from the default ignore list."""
optmanager.remove_from_default_ignore([self.name])
optmanager.extend_default_select([self.name])
+ if not options:
+ return
+ try:
+ options.ignore.remove(self.name)
+ except (ValueError, KeyError):
+ LOG.debug('Attempted to remove %s from the ignore list but it was '
+ 'not a member of the list.', self.name)
def disable(self, optmanager):
"""Add the plugin name to the default ignore list."""
@@ -202,7 +209,7 @@ class Plugin(object):
parse_options(options)
if self.name in options.enable_extensions:
- self.enable(optmanager)
+ self.enable(optmanager, options)
def register_options(self, optmanager):
"""Register the plugin's command-line options on the OptionManager.