mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-11 23:34:17 +00:00
Make _flake8_noqa tighter
Only match '\s*# flake8[:=]\s*nqa' when it happens at the beginning of a
line. The previous version of this regex is incorrectly hitting the
following line:
# Any "# flake8: noqa" line?
Causing flake8 to not be run on engine.py.
Also fix flake8 issues in engine.py.
This commit is contained in:
parent
a059cb79fd
commit
edafc04972
1 changed files with 4 additions and 7 deletions
|
|
@ -8,7 +8,7 @@ from flake8 import __version__
|
||||||
from flake8.reporter import multiprocessing, BaseQReport, QueueReport
|
from flake8.reporter import multiprocessing, BaseQReport, QueueReport
|
||||||
from flake8.util import OrderedSet, is_windows, is_using_stdin
|
from flake8.util import OrderedSet, is_windows, is_using_stdin
|
||||||
|
|
||||||
_flake8_noqa = re.compile(r'flake8[:=]\s*noqa', re.I).search
|
_flake8_noqa = re.compile(r'\s*# flake8[:=]\s*noqa', re.I).match
|
||||||
|
|
||||||
EXTRA_EXCLUDE = '.tox'
|
EXTRA_EXCLUDE = '.tox'
|
||||||
|
|
||||||
|
|
@ -65,10 +65,6 @@ def get_parser():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if multiprocessing:
|
if multiprocessing:
|
||||||
try:
|
|
||||||
auto = multiprocessing.cpu_count() or 1
|
|
||||||
except NotImplementedError:
|
|
||||||
auto = 1
|
|
||||||
parser.config_options.append('jobs')
|
parser.config_options.append('jobs')
|
||||||
parser.add_option('-j', '--jobs', type='string', default='auto',
|
parser.add_option('-j', '--jobs', type='string', default='auto',
|
||||||
help="number of jobs to run simultaneously, "
|
help="number of jobs to run simultaneously, "
|
||||||
|
|
@ -81,7 +77,8 @@ def get_parser():
|
||||||
# See comment above regarding why this has to be a callback.
|
# See comment above regarding why this has to be a callback.
|
||||||
parser.add_option('--install-hook', default=False, dest='install_hook',
|
parser.add_option('--install-hook', default=False, dest='install_hook',
|
||||||
help='Install the appropriate hook for this '
|
help='Install the appropriate hook for this '
|
||||||
'repository.', action='callback', callback=_install_hook_cb)
|
'repository.', action='callback',
|
||||||
|
callback=_install_hook_cb)
|
||||||
return parser, options_hooks
|
return parser, options_hooks
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue