mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-05 04:36:52 +00:00
Fix bug for plugins using extend_default_ignore
Since Flake8 3.0 we've had the ability for plugins to use `extend_default_ignore` to register codes they want disabled by default. This, however, was a permanent disabling unfortunately. Our code didn't have a way of understanding that this new set of `ignore` codes was actually the 'default' set for that run. Much like the extended_select_list, we now attach extended_ignore_list to be able to confidently determine if the ignore we get in the DecisionEngine is actually the Default Ignore list and what plugins what us to ignore by default. Refs https://github.com/PyCQA/pep8-naming/pull/157
This commit is contained in:
parent
434c108f74
commit
e3313e0949
4 changed files with 71 additions and 25 deletions
|
|
@ -47,6 +47,10 @@ def aggregate_options(
|
|||
# Extend the default ignore value with the extended default ignore list,
|
||||
# registered by plugins.
|
||||
extended_default_ignore = manager.extended_default_ignore.copy()
|
||||
# Let's store our extended default ignore for use by the decision engine
|
||||
default_values.extended_default_ignore = (
|
||||
manager.extended_default_ignore.copy()
|
||||
)
|
||||
LOG.debug(
|
||||
"Extended default ignore list: %s", list(extended_default_ignore)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -166,7 +166,9 @@ class DecisionEngine(object):
|
|||
reverse=True,
|
||||
)
|
||||
)
|
||||
self.using_default_ignore = set(self.ignored) == set(defaults.IGNORE)
|
||||
self.using_default_ignore = set(self.ignored) == set(
|
||||
defaults.IGNORE
|
||||
).union(options.extended_default_ignore)
|
||||
self.using_default_select = set(self.selected) == set(defaults.SELECT)
|
||||
|
||||
def _in_all_selected(self, code): # type: (str) -> bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue