diff options
author | Ian Cordasco <sigmavirus24@users.noreply.github.com> | 2015-09-07 14:07:09 -0500 |
---|---|---|
committer | Ian Cordasco <sigmavirus24@users.noreply.github.com> | 2015-09-07 14:07:09 -0500 |
commit | 5feba521a7cbe51b2bcb0be5f7d5c06710c1a8d3 (patch) | |
tree | f99ed0fb6ead6415707d0a0d71f9e93fa1b353f9 /pep8.py | |
parent | 151758ce8f29fd65e10dc0720446c5a3bb164602 (diff) | |
parent | e7d64d3062421707a1c896b25cc5134922bcd9ee (diff) | |
download | pep8-5feba521a7cbe51b2bcb0be5f7d5c06710c1a8d3.tar.gz |
Merge pull request #429 from doismellburning/feature/file-parsing-flexibility
Multi-line ignore parsing in config_file
Diffstat (limited to 'pep8.py')
-rwxr-xr-x | pep8.py | 22 |
1 files changed, 19 insertions, 3 deletions
@@ -2081,10 +2081,10 @@ def process_options(arglist=None, parse_argv=False, config_file=None, options = read_config(options, args, arglist, parser) options.reporter = parse_argv and options.quiet == 1 and FileReport - options.filename = options.filename and options.filename.split(',') + options.filename = _parse_multi_options(options.filename.split(',')) options.exclude = normalize_paths(options.exclude) - options.select = options.select and options.select.split(',') - options.ignore = options.ignore and options.ignore.split(',') + options.select = _parse_multi_options(options.select.split(',')) + options.ignore = _parse_multi_options(options.ignore.split(',')) if options.diff: options.reporter = DiffReport @@ -2095,6 +2095,22 @@ def process_options(arglist=None, parse_argv=False, config_file=None, return options, args +def _parse_multi_options(options): + r"""Split and strip and discard empties. + + Turns the following: + + A, + B, + + into ["A", "B"] + """ + if options: + return [o.strip() for o in options if o.strip()] + else: + return options + + def _main(): """Parse options and run checks on Python source.""" import signal |