mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-29 10:36:53 +00:00
Fix parsing ignore
https://gitlab.com/pycqa/flake8/issues/40 * Adding an ignore option in [flake8] wasn't working because pep8.StyleGuide turned the string sent in into a tuple, which the option parser needs to receive as an iterable that isn't a string. Split on spaces, commas, or semicolons using re.findall in order to get a list of error/warnings to pass to StyleGuide properly. * Add self to contributors
This commit is contained in:
parent
d2e873fa9e
commit
8f8a7d458f
3 changed files with 7 additions and 1 deletions
|
|
@ -22,3 +22,4 @@ Contributors (by order of appearance) :
|
|||
- Austin Morton
|
||||
- Michael McNeil Forbes
|
||||
- Christian Long
|
||||
- Tyrel Souza
|
||||
|
|
@ -118,7 +118,7 @@ def get_style_guide(**kwargs):
|
|||
elif not options.exclude:
|
||||
options.exclude = []
|
||||
|
||||
# Add pattersn in EXTRA_EXCLUDE to the list of excluded patterns
|
||||
# Add patterns in EXTRA_EXCLUDE to the list of excluded patterns
|
||||
options.exclude.extend(pep8.normalize_paths(EXTRA_EXCLUDE))
|
||||
|
||||
for options_hook in options_hooks:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
import setuptools
|
||||
|
|
@ -105,6 +106,10 @@ class Flake8Command(setuptools.Command):
|
|||
continue
|
||||
if is_flag(value):
|
||||
value = flag_on(value)
|
||||
# Check if there's any values that need to be fixed.
|
||||
if option_name == "include" and isinstance(value, str):
|
||||
value = re.findall('[^,;\s]+', value)
|
||||
|
||||
self.options_dict[option_name] = value
|
||||
|
||||
def distribution_files(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue