summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan Stapleton Cordasco <graffatcolmingov@gmail.com>2021-04-15 09:12:25 -0500
committerAnthony Sottile <asottile@umich.edu>2021-04-15 18:42:17 -0700
commite3313e0949472c1c3e9a6618615c9dc0c46291b2 (patch)
tree9a99c1a295e93a725aab9a8f1aebd5ba071328db /src
parent434c108f7491b589362752b12979741598bb2dff (diff)
downloadflake8-e3313e0949472c1c3e9a6618615c9dc0c46291b2.tar.gz
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
Diffstat (limited to 'src')
-rw-r--r--src/flake8/options/aggregator.py4
-rw-r--r--src/flake8/style_guide.py4
2 files changed, 7 insertions, 1 deletions
diff --git a/src/flake8/options/aggregator.py b/src/flake8/options/aggregator.py
index bdcd6a3..31adf9d 100644
--- a/src/flake8/options/aggregator.py
+++ b/src/flake8/options/aggregator.py
@@ -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)
)
diff --git a/src/flake8/style_guide.py b/src/flake8/style_guide.py
index 9be0fe8..91d21ab 100644
--- a/src/flake8/style_guide.py
+++ b/src/flake8/style_guide.py
@@ -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