Skip to content

Commit

Permalink
Stop checking for string option type
Browse files Browse the repository at this point in the history
There's no need to explicitly check for a string type when parsing the
configuration file. When it's neither an integer or a boolean, the only
value it can logically be is string-like.

Closes PyCQAgh-561
  • Loading branch information
sigmavirus24 committed Jul 25, 2016
1 parent 0babee5 commit d4b8f49
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pycodestyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -2149,13 +2149,12 @@ def read_config(options, args, arglist, parser):
opt_type = option_list[normalized_opt]
if opt_type in ('int', 'count'):
value = config.getint(pep8_section, opt)
elif opt_type == 'string':
elif opt_type in ('store_true', 'store_false'):
value = config.getboolean(pep8_section, opt)
else:
value = config.get(pep8_section, opt)
if normalized_opt == 'exclude':
value = normalize_paths(value, local_dir)
else:
assert opt_type in ('store_true', 'store_false')
value = config.getboolean(pep8_section, opt)
setattr(new_options, normalized_opt, value)

# Third, overwrite with the command-line options
Expand Down

0 comments on commit d4b8f49

Please sign in to comment.