mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-05 20:46:54 +00:00
Parse hyphenated config names also
Previously Flake8 parsed both
max-line-length = 110
And
max_line_length = 110
From the config file without issue. When we updated our logic, I forgot
to test for that and we lost that behaviour temporarily.
Closes #152
This commit is contained in:
parent
95c373cf11
commit
31c32e3327
4 changed files with 37 additions and 2 deletions
|
|
@ -192,7 +192,7 @@ class MergedConfigParser(object):
|
|||
LOG.debug('Option "%s" returned value: %r', option_name, value)
|
||||
|
||||
final_value = self._normalize_value(option, value)
|
||||
config_dict[option_name] = final_value
|
||||
config_dict[option.config_name] = final_value
|
||||
|
||||
return config_dict
|
||||
|
||||
|
|
|
|||
|
|
@ -186,7 +186,9 @@ class OptionManager(object):
|
|||
self.parser.add_option(option.to_optparse())
|
||||
self.options.append(option)
|
||||
if option.parse_from_config:
|
||||
self.config_options_dict[option.config_name] = option
|
||||
name = option.config_name
|
||||
self.config_options_dict[name] = option
|
||||
self.config_options_dict[name.replace('_', '-')] = option
|
||||
LOG.debug('Registered option "%s".', option)
|
||||
|
||||
def remove_from_default_ignore(self, error_codes):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue