mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-12 15:44:17 +00:00
make sure pep8style is always initialized
This commit is contained in:
parent
c89ac53cfb
commit
982b089243
1 changed files with 3 additions and 6 deletions
|
|
@ -119,6 +119,9 @@ class _PEP8Options(object):
|
||||||
|
|
||||||
def _initpep8():
|
def _initpep8():
|
||||||
# default pep8 setup
|
# default pep8 setup
|
||||||
|
global pep8style
|
||||||
|
if pep8style is None:
|
||||||
|
pep8style = pep8.StyleGuide(config_file=True)
|
||||||
pep8.options = _PEP8Options()
|
pep8.options = _PEP8Options()
|
||||||
pep8.options.physical_checks = pep8.find_checks('physical_line')
|
pep8.options.physical_checks = pep8.find_checks('physical_line')
|
||||||
pep8.options.logical_checks = pep8.find_checks('logical_line')
|
pep8.options.logical_checks = pep8.find_checks('logical_line')
|
||||||
|
|
@ -136,9 +139,6 @@ def run(command):
|
||||||
|
|
||||||
|
|
||||||
def git_hook(complexity=-1, strict=False, ignore=None):
|
def git_hook(complexity=-1, strict=False, ignore=None):
|
||||||
global pep8style
|
|
||||||
pep8style = pep8.StyleGuide(config_file=True)
|
|
||||||
|
|
||||||
_initpep8()
|
_initpep8()
|
||||||
if ignore:
|
if ignore:
|
||||||
pep8.options.ignore = ignore
|
pep8.options.ignore = ignore
|
||||||
|
|
@ -201,9 +201,6 @@ else:
|
||||||
yield "%s.py" % filename
|
yield "%s.py" % filename
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
global pep8style
|
|
||||||
pep8style = pep8.StyleGuide(config_file=True)
|
|
||||||
|
|
||||||
_initpep8()
|
_initpep8()
|
||||||
|
|
||||||
# _get_python_files can produce the same file several
|
# _get_python_files can produce the same file several
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue