File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -434,11 +434,26 @@ def parse_section(
434434 """
435435 results : dict [str , object ] = {}
436436 report_dirs : dict [str , str ] = {}
437+
438+ # Because these fields exist on Options, without proactive checking, we would accept them
439+ # and crash later
440+ invalid_options = {
441+ "enabled_error_codes" : "enable_error_code" ,
442+ "disabled_error_codes" : "disable_error_code" ,
443+ }
444+
437445 for key in section :
438446 invert = False
439447 options_key = key
440448 if key in config_types :
441449 ct = config_types [key ]
450+ elif key in invalid_options :
451+ print (
452+ f"{ prefix } Unrecognized option: { key } = { section [key ]} "
453+ f" (did you mean { invalid_options [key ]} ?)" ,
454+ file = stderr ,
455+ )
456+ continue
442457 else :
443458 dv = None
444459 # We have to keep new_semantic_analyzer in Options
You can’t perform that action at this time.
0 commit comments