mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-10 14:54:17 +00:00
Use option_normalizer
This commit is contained in:
parent
f67552d09a
commit
28138a2135
1 changed files with 2 additions and 3 deletions
|
|
@ -6,7 +6,7 @@ import sys
|
||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
from flake8.engine import get_parser, get_style_guide
|
from flake8.engine import get_parser, get_style_guide
|
||||||
from flake8.util import is_flag, flag_on
|
from flake8.util import is_flag, flag_on, option_normalizer
|
||||||
|
|
||||||
if sys.platform.startswith('win'):
|
if sys.platform.startswith('win'):
|
||||||
DEFAULT_CONFIG = os.path.expanduser(r'~\.flake8')
|
DEFAULT_CONFIG = os.path.expanduser(r'~\.flake8')
|
||||||
|
|
@ -104,8 +104,7 @@ class Flake8Command(setuptools.Command):
|
||||||
value = getattr(self, option_name)
|
value = getattr(self, option_name)
|
||||||
if value is None:
|
if value is None:
|
||||||
continue
|
continue
|
||||||
if is_flag(value):
|
value = option_normalizer(value)
|
||||||
value = flag_on(value)
|
|
||||||
# Check if there's any values that need to be fixed.
|
# Check if there's any values that need to be fixed.
|
||||||
if option_name == "include" and isinstance(value, str):
|
if option_name == "include" and isinstance(value, str):
|
||||||
value = re.findall('[^,;\s]+', value)
|
value = re.findall('[^,;\s]+', value)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue