From 551bce11a3e7ac328a3859faa0ab854c719863c1 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Sun, 24 Jan 2016 15:19:44 -0600 Subject: [PATCH] Add extend_default_ignore list to OptionManager --- flake8/options/manager.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flake8/options/manager.py b/flake8/options/manager.py index 1dd6c8d..da3f73e 100644 --- a/flake8/options/manager.py +++ b/flake8/options/manager.py @@ -156,6 +156,7 @@ class OptionManager(object): self.program_name = prog self.version = version self.registered_plugins = set() + self.extended_default_ignore = set() @staticmethod def format_plugin(plugin_tuple): @@ -182,6 +183,15 @@ class OptionManager(object): self.config_options_dict[option.config_name] = option LOG.debug('Registered option "%s".', option) + def extend_default_ignore(self, error_codes): + """Extend the default ignore list with the error codes provided. + + :param list error_codes: + List of strings that are the error/warning codes with which to + extend the default ignore list. + """ + self.extended_default_ignore.update(error_codes) + def generate_versions(self, format_str='%(name)s: %(version)s'): """Generate a comma-separated list of versions of plugins.""" return ', '.join(