summaryrefslogtreecommitdiff
path: root/flake8
diff options
context:
space:
mode:
Diffstat (limited to 'flake8')
-rw-r--r--flake8/plugins/manager.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/flake8/plugins/manager.py b/flake8/plugins/manager.py
index 56ee813..fe51391 100644
--- a/flake8/plugins/manager.py
+++ b/flake8/plugins/manager.py
@@ -108,6 +108,11 @@ class Plugin(object):
return self._plugin_name
+ @property
+ def off_by_default(self):
+ """Return whether the plugin is ignored by default."""
+ return getattr(self.plugin, 'off_by_default', False)
+
def execute(self, *args, **kwargs):
r"""Call the plugin with \*args and \*\*kwargs."""
return self.plugin(*args, **kwargs) # pylint: disable=not-callable
@@ -181,6 +186,9 @@ class Plugin(object):
)
add_options(optmanager)
+ if self.off_by_default:
+ optmanager.extend_default_ignore([self.name])
+
class PluginManager(object): # pylint: disable=too-few-public-methods
"""Find and manage plugins consistently."""