mirror of
https://github.com/PyCQA/flake8.git
synced 2026-07-02 18:09:30 +00:00
skip config options that are no longer registered with the active OptionManager
This commit is contained in:
parent
bb943328ef
commit
564f7f8aef
1 changed files with 19 additions and 2 deletions
|
|
@ -39,8 +39,25 @@ def aggregate_options(
|
||||||
# If the config name is somehow different from the destination name,
|
# If the config name is somehow different from the destination name,
|
||||||
# fetch the destination name from our Option
|
# fetch the destination name from our Option
|
||||||
if not hasattr(default_values, config_name):
|
if not hasattr(default_values, config_name):
|
||||||
dest_val = manager.config_options_dict[config_name].dest
|
try:
|
||||||
assert isinstance(dest_val, str)
|
option = manager.config_options_dict[config_name]
|
||||||
|
except KeyError:
|
||||||
|
LOG.warning(
|
||||||
|
'Config option "%s" is not registered with the active '
|
||||||
|
"OptionManager; ignoring value %r",
|
||||||
|
config_name,
|
||||||
|
value,
|
||||||
|
)
|
||||||
|
continue
|
||||||
|
dest_val = option.dest
|
||||||
|
if not isinstance(dest_val, str):
|
||||||
|
LOG.warning(
|
||||||
|
'Config option "%s" has no explicit "dest" attribute; '
|
||||||
|
"ignoring value %r",
|
||||||
|
config_name,
|
||||||
|
value,
|
||||||
|
)
|
||||||
|
continue
|
||||||
dest_name = dest_val
|
dest_name = dest_val
|
||||||
|
|
||||||
LOG.debug(
|
LOG.debug(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue