Skip to content

Commit 87b75ae

Browse files
bors[bot]pyup-botrehandalal
committed
Merge #42
42: Update flake8 to 3.6.0 r=rehandalal a=pyup-bot This PR updates [flake8](https://pypi.org/project/flake8) from **3.5.0** to **3.6.0**. <details> <summary>Changelog</summary> ### 3.6.0 ``` ------------------- You can view the `3.6.0 milestone`_ on GitLab for more details. New Dependency Information ~~~~~~~~~~~~~~~~~~~~~~~~~~ - pycodestyle has been updated to &gt;= 2.4.0, &lt; 2.5.0 (See also `GitLab381`_, `GitLab415`_, `GitLab!212`_, `GitLab!230`_, `GitLab!231`_) - Pyflakes has been updated to &gt;= 2.0.0, &lt; 2.1.0 (See also `GitLab422`_, `GitLab!239`_) - flake8 requires python 2.x &gt;= 2.7 or python 3.x &gt;= 3.4 (See also `GitLab!225`_) Features ~~~~~~~~ - Add ``paths`` to allow local plugins to exist outside of ``sys.path`` (See also `GitLab379`_, `GitLab!211`_) - Copy ``setup.cfg`` files to the temporary git hook execution directory (See also `GitLab!215`_) - Only skip a file if `` flake8: noqa`` is on a line by itself (See also `GitLab453`_, `GitLab!219`_) - Provide a better user experience for broken plugins (See also `GitLab!221`_) - Report ``E902`` when a file passed on the command line does not exist (See also `GitLab405`_, `GitLab!227`_) - Add ``--extend-ignore`` for extending the default ``ignore`` instead of overriding it (See also `GitLab!233`_) Bugs Fixed ~~~~~~~~~~ - Respect a formatter&#39;s newline setting when printing (See also `GitLab!222`_) - Fix leaking of processes in the legacy api (See also `GitLab410`_, `GitLab!228`_) - Fix a ``SyntaxWarning`` for an invalid escape sequence (See also `GitLab!244`_) - Fix ``DeprecationWarning`` due to import of ``abc`` classes from the ``collections`` module (See also `GitLab!249`_) - Defer ``setuptools`` import to improve flake8 startup time (See also `GitLab365`_, `GitLab!250`_) - Fix inconsistent line endings in ``FileProcessor.lines`` when running under python 3.x (See also `GitLab457`_, `GitLab!255`_) .. all links .. _3.6.0 milestone: https://gitlab.com/pycqa/flake8/milestones/21 .. issue links .. _GitLab365: https://gitlab.com/pycqa/flake8/issues/365 .. _GitLab379: https://gitlab.com/pycqa/flake8/issues/379 .. _GitLab381: https://gitlab.com/pycqa/flake8/issues/381 .. _GitLab405: https://gitlab.com/pycqa/flake8/issues/405 .. _GitLab410: https://gitlab.com/pycqa/flake8/issues/410 .. _GitLab415: https://gitlab.com/pycqa/flake8/issues/415 .. _GitLab422: https://gitlab.com/pycqa/flake8/issues/422 .. _GitLab453: https://gitlab.com/pycqa/flake8/issues/453 .. _GitLab457: https://gitlab.com/pycqa/flake8/issues/457 .. merge request links .. _GitLab!211: https://gitlab.com/pycqa/flake8/merge_requests/211 .. _GitLab!212: https://gitlab.com/pycqa/flake8/merge_requests/212 .. _GitLab!215: https://gitlab.com/pycqa/flake8/merge_requests/215 .. _GitLab!219: https://gitlab.com/pycqa/flake8/merge_requests/219 .. _GitLab!221: https://gitlab.com/pycqa/flake8/merge_requests/221 .. _GitLab!222: https://gitlab.com/pycqa/flake8/merge_requests/222 .. _GitLab!225: https://gitlab.com/pycqa/flake8/merge_requests/225 .. _GitLab!227: https://gitlab.com/pycqa/flake8/merge_requests/227 .. _GitLab!228: https://gitlab.com/pycqa/flake8/merge_requests/228 .. _GitLab!230: https://gitlab.com/pycqa/flake8/merge_requests/230 .. _GitLab!231: https://gitlab.com/pycqa/flake8/merge_requests/231 .. _GitLab!233: https://gitlab.com/pycqa/flake8/merge_requests/233 .. _GitLab!239: https://gitlab.com/pycqa/flake8/merge_requests/239 .. _GitLab!244: https://gitlab.com/pycqa/flake8/merge_requests/244 .. _GitLab!249: https://gitlab.com/pycqa/flake8/merge_requests/249 .. _GitLab!250: https://gitlab.com/pycqa/flake8/merge_requests/250 .. _GitLab!255: https://gitlab.com/pycqa/flake8/merge_requests/255 ``` </details> <details> <summary>Links</summary> - PyPI: https://pypi.org/project/flake8 - Changelog: https://pyup.io/changelogs/flake8/ - Repo: https://gitlab.com/pycqa/flake8 </details> Co-authored-by: pyup-bot <[email protected]> Co-authored-by: Rehan Dalal <[email protected]>
2 parents 83561f3 + e4b3c5e commit 87b75ae

File tree

4 files changed

+37
-37
lines changed

4 files changed

+37
-37
lines changed

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
-r requirements.txt
2-
flake8==3.5.0
2+
flake8==3.6.0
33
pytest==3.9.3
44
pytest-cov==2.6.0

tests/test_cli.py

+31-31
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def test_run(self, cli_runner, project):
302302

303303
with chdir(project.path):
304304
result = cli_runner.invoke(cli.run)
305-
assert re.search('Linting.+?\[SUCCESS]', result.output)
305+
assert re.search(r'Linting.+?\[SUCCESS]', result.output)
306306
assert not result.exception
307307
assert result.exit_code == 0
308308

@@ -319,7 +319,7 @@ def test_fails(self, cli_runner, project):
319319

320320
with chdir(project.path):
321321
result = cli_runner.invoke(cli.run)
322-
assert re.search('Linting.+?\[FAILURE]', result.output)
322+
assert re.search(r'Linting.+?\[FAILURE]', result.output)
323323
assert result.exception
324324
assert result.exit_code == 2
325325

@@ -329,7 +329,7 @@ def test_action(self, cli_runner, project):
329329

330330
with chdir(project.path):
331331
result = cli_runner.invoke(cli.run, ['-a', 'lint'])
332-
assert re.search('Linting.+?\[SUCCESS]', result.output)
332+
assert re.search(r'Linting.+?\[SUCCESS]', result.output)
333333
assert not result.exception
334334
assert result.exit_code == 0
335335

@@ -340,8 +340,8 @@ def test_action_with_fix(self, cli_runner, project):
340340

341341
with chdir(project.path):
342342
result = cli_runner.invoke(cli.run, ['-a', 'lint', '--fix'])
343-
assert re.search('Linting.+?\[SUCCESS]', result.output)
344-
assert re.search('Modified files:.+?pass.py.+?<- Linting', result.output, flags=re.DOTALL)
343+
assert re.search(r'Linting.+?\[SUCCESS]', result.output)
344+
assert re.search(r'Modified files:.+?pass.py.+?<- Linting', result.output, flags=re.DOTALL)
345345
assert not result.exception
346346
assert result.exit_code == 0
347347
assert project.read('pass.py') == 'FIXED'
@@ -354,8 +354,8 @@ def test_action_stage_modified_files(self, cli_runner, project):
354354

355355
with chdir(project.path):
356356
result = cli_runner.invoke(cli.run, ['-a', 'lint', '--fix', '--stage-modified-files'])
357-
assert re.search('Linting.+?\[SUCCESS]', result.output)
358-
assert re.search('Modified files:.+?pass.py.+?<- Linting', result.output, flags=re.DOTALL)
357+
assert re.search(r'Linting.+?\[SUCCESS]', result.output)
358+
assert re.search(r'Modified files:.+?pass.py.+?<- Linting', result.output, flags=re.DOTALL)
359359
assert not result.exception
360360
assert result.exit_code == 0
361361
assert project.read('pass.py') == 'FIXED'
@@ -367,7 +367,7 @@ def test_action_fails(self, cli_runner, project):
367367

368368
with chdir(project.path):
369369
result = cli_runner.invoke(cli.run, ['-a', 'lint'])
370-
assert re.search('Linting.+?\[FAILURE]', result.output)
370+
assert re.search(r'Linting.+?\[FAILURE]', result.output)
371371
assert result.exception
372372
assert result.exit_code == 2
373373

@@ -398,7 +398,7 @@ def test_plugin(self, cli_runner, project):
398398

399399
with chdir(project.path):
400400
result = cli_runner.invoke(cli.run, ['-p', 'simple'])
401-
assert re.search('simple.+?\[SUCCESS]', result.output)
401+
assert re.search(r'simple.+?\[SUCCESS]', result.output)
402402
assert not result.exception
403403
assert result.exit_code == 0
404404

@@ -408,7 +408,7 @@ def test_plugin_fails(self, cli_runner, project, mock_plugin):
408408

409409
with chdir(project.path):
410410
result = cli_runner.invoke(cli.run, ['-p', 'simple'])
411-
assert re.search('simple.+?\[FAILURE]', result.output)
411+
assert re.search(r'simple.+?\[FAILURE]', result.output)
412412
assert result.exception
413413
assert result.exit_code == 2
414414

@@ -429,7 +429,7 @@ def test_on_file(self, cli_runner, project):
429429

430430
with chdir(project.path):
431431
result = cli_runner.invoke(cli.run, ['pass.py'])
432-
assert re.search('Linting.+?\[SUCCESS]', result.output)
432+
assert re.search(r'Linting.+?\[SUCCESS]', result.output)
433433
assert not result.exception
434434
assert result.exit_code == 0
435435

@@ -439,7 +439,7 @@ def test_on_file_fail(self, cli_runner, project):
439439

440440
with chdir(project.path):
441441
result = cli_runner.invoke(cli.run, ['fail.py'])
442-
assert re.search('Linting.+?\[FAILURE]', result.output)
442+
assert re.search(r'Linting.+?\[FAILURE]', result.output)
443443
assert result.exception
444444
assert result.exit_code == 2
445445

@@ -449,7 +449,7 @@ def test_dir(self, cli_runner, project):
449449

450450
with chdir(project.path):
451451
result = cli_runner.invoke(cli.run, ['dir'])
452-
assert re.search('Linting.+?\[SUCCESS]', result.output)
452+
assert re.search(r'Linting.+?\[SUCCESS]', result.output)
453453
assert not result.exception
454454
assert result.exit_code == 0
455455

@@ -459,7 +459,7 @@ def test_dir_fail(self, cli_runner, project):
459459

460460
with chdir(project.path):
461461
result = cli_runner.invoke(cli.run, ['dir'])
462-
assert re.search('Linting.+?\[FAILURE]', result.output)
462+
assert re.search(r'Linting.+?\[FAILURE]', result.output)
463463
assert result.exception
464464
assert result.exit_code == 2
465465

@@ -469,7 +469,7 @@ def test_file(self, cli_runner, project):
469469

470470
with chdir(project.path):
471471
result = cli_runner.invoke(cli.run, ['pass.py'])
472-
assert re.search('Linting.+?\[SUCCESS]', result.output)
472+
assert re.search(r'Linting.+?\[SUCCESS]', result.output)
473473
assert not result.exception
474474
assert result.exit_code == 0
475475

@@ -479,7 +479,7 @@ def test_file_fail(self, cli_runner, project):
479479

480480
with chdir(project.path):
481481
result = cli_runner.invoke(cli.run, ['fail.py'])
482-
assert re.search('Linting.+?\[FAILURE]', result.output)
482+
assert re.search(r'Linting.+?\[FAILURE]', result.output)
483483
assert result.exception
484484
assert result.exit_code == 2
485485

@@ -492,7 +492,7 @@ def test_include_untracked(self, cli_runner, project):
492492
assert result.exit_code == 0
493493

494494
result = cli_runner.invoke(cli.run, ['--include-untracked'])
495-
assert re.search('Linting.+?\[FAILURE]', result.output)
495+
assert re.search(r'Linting.+?\[FAILURE]', result.output)
496496
assert result.exception
497497
assert result.exit_code == 2
498498

@@ -508,7 +508,7 @@ def test_include_unstaged(self, cli_runner, project):
508508
assert result.exit_code == 0
509509

510510
result = cli_runner.invoke(cli.run, ['--include-unstaged'])
511-
assert re.search('Linting.+?\[FAILURE]', result.output)
511+
assert re.search(r'Linting.+?\[FAILURE]', result.output)
512512
assert result.exception
513513
assert result.exit_code == 2
514514

@@ -520,7 +520,7 @@ def test_unstaged_changes(self, cli_runner, project):
520520
with chdir(project.path):
521521
result = cli_runner.invoke(cli.run)
522522
assert 'You have unstaged changes.' in result.output
523-
assert re.search('Linting.+?\[FAILURE]', result.output)
523+
assert re.search(r'Linting.+?\[FAILURE]', result.output)
524524
assert result.exception
525525
assert result.exit_code == 2
526526
assert project.read('pass.py') == 'x'
@@ -533,7 +533,7 @@ def test_include_unstaged_changes(self, cli_runner, project):
533533
with chdir(project.path):
534534
result = cli_runner.invoke(cli.run, ['--include-unstaged-changes'])
535535
assert 'You have unstaged changes.' in result.output
536-
assert re.search('Linting.+?\[SUCCESS]', result.output)
536+
assert re.search(r'Linting.+?\[SUCCESS]', result.output)
537537
assert not result.exception
538538
assert result.exit_code == 0
539539
assert project.read('pass.py') == 'x'
@@ -545,7 +545,7 @@ def test_use_tracked_files(self, cli_runner, project):
545545

546546
with chdir(project.path):
547547
result = cli_runner.invoke(cli.run, ['--use-tracked-files'])
548-
assert re.search('Linting.+?\[FAILURE]', result.output)
548+
assert re.search(r'Linting.+?\[FAILURE]', result.output)
549549
assert result.exception
550550
assert result.exit_code == 2
551551

@@ -558,7 +558,7 @@ def test_use_tracked_files_include_untracked(self, cli_runner, project):
558558

559559
with chdir(project.path):
560560
result = cli_runner.invoke(cli.run, ['--use-tracked-files', '--include-untracked'])
561-
assert re.search('Linting.+?\[FAILURE]', result.output)
561+
assert re.search(r'Linting.+?\[FAILURE]', result.output)
562562
assert result.exception
563563
assert result.exit_code == 2
564564

@@ -605,7 +605,7 @@ def test_junit_xml(self, cli_runner, project):
605605

606606
with chdir(project.path):
607607
result = cli_runner.invoke(cli.run, ['--junit-xml=junit.xml'])
608-
assert re.search('Linting.+?\[FAILURE]', result.output)
608+
assert re.search(r'Linting.+?\[FAILURE]', result.output)
609609
assert result.exception
610610
assert result.exit_code == 2
611611
assert project.exists('junit.xml')
@@ -620,7 +620,7 @@ def test_errors(self, cli_runner, project):
620620

621621
with chdir(project.path):
622622
result = cli_runner.invoke(cli.run)
623-
assert re.search('Linting.+?\[ERROR!!]', result.output)
623+
assert re.search(r'Linting.+?\[ERROR!!]', result.output)
624624
assert result.exception
625625
assert result.exit_code == 1
626626

@@ -640,7 +640,7 @@ def test_use_shortcut(self, cli_runner, project):
640640
with chdir(project.path):
641641
result = cli_runner.invoke(cli.use, ['lint'])
642642
assert '$ therapist run --action lint --include-untracked' in result.output
643-
assert re.search('Linting.+?\[SUCCESS]', result.output)
643+
assert re.search(r'Linting.+?\[SUCCESS]', result.output)
644644
assert not result.exception
645645
assert result.exit_code == 0
646646

@@ -652,8 +652,8 @@ def test_use_extended_shortcut(self, cli_runner, project):
652652
with chdir(project.path):
653653
result = cli_runner.invoke(cli.use, ['fix'])
654654
assert '$ therapist run --action lint --fix --include-untracked' in result.output
655-
assert re.search('Linting.+?\[SUCCESS]', result.output)
656-
assert re.search('Modified files:.+?pass.py.+?<- Linting', result.output, flags=re.DOTALL)
655+
assert re.search(r'Linting.+?\[SUCCESS]', result.output)
656+
assert re.search(r'Modified files:.+?pass.py.+?<- Linting', result.output, flags=re.DOTALL)
657657
assert not result.exception
658658
assert result.exit_code == 0
659659
assert project.read('pass.py') == 'FIXED'
@@ -667,8 +667,8 @@ def test_extend_extended_shortcut(self, cli_runner, project):
667667
with chdir(project.path):
668668
result = cli_runner.invoke(cli.use, ['fix:all'])
669669
assert '$ therapist run --action lint --fix --include-untracked --use-tracked-files' in result.output
670-
assert re.search('Linting.+?\[SUCCESS]', result.output)
671-
assert re.search('Modified files:.+?pass.py.+?<- Linting', result.output, flags=re.DOTALL)
670+
assert re.search(r'Linting.+?\[SUCCESS]', result.output)
671+
assert re.search(r'Modified files:.+?pass.py.+?<- Linting', result.output, flags=re.DOTALL)
672672
assert not result.exception
673673
assert result.exit_code == 0
674674
assert project.read('pass.py') == 'FIXED'
@@ -783,7 +783,7 @@ def test_hook_with_fix(self, cli_runner, project):
783783
project.git.add('.')
784784

785785
out, err, code = project.git.commit(m='Add a file.')
786-
assert re.search('Modified files:.+?pass.py.+?<- Linting', err, flags=re.DOTALL)
786+
assert re.search(r'Modified files:.+?pass.py.+?<- Linting', err, flags=re.DOTALL)
787787
assert '[SUCCESS]' in err
788788

789789
out, err, code = project.git.status(porcelain=True)
@@ -804,7 +804,7 @@ def test_hook_with_fix_without_stage_modified_files(self, cli_runner, project):
804804
project.git.add('.')
805805

806806
out, err, code = project.git.commit(m='Add a file.')
807-
assert re.search('Modified files:.+?pass.py.+?<- Linting', err, flags=re.DOTALL)
807+
assert re.search(r'Modified files:.+?pass.py.+?<- Linting', err, flags=re.DOTALL)
808808
assert '[SUCCESS]' in err
809809

810810
out, err, code = project.git.status(porcelain=True)

therapist/cli.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ def run(**kwargs):
263263
if plugin:
264264
try:
265265
processes = [config.plugins.get(plugin)]
266-
except config.plugins.DoesNotExist as err:
267-
output('{}\nAvailable plugins:'.format(err.message))
266+
except config.plugins.DoesNotExist as e:
267+
output('{}\nAvailable plugins:'.format(e.message))
268268

269269
for p in config.plugins:
270270
output(p.name)
@@ -273,8 +273,8 @@ def run(**kwargs):
273273
if action:
274274
try:
275275
processes = [config.actions.get(action)]
276-
except config.actions.DoesNotExist as err:
277-
output('{}\nAvailable actions:'.format(err.message))
276+
except config.actions.DoesNotExist as e:
277+
output('{}\nAvailable actions:'.format(e.message))
278278

279279
for a in config.actions:
280280
output(a.name)

therapist/utils/git/status.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def __init__(self, status):
77
self.is_modified = status[1] == 'M'
88

99
if self.is_renamed:
10-
matches = re.search('(\S+?)\s+->\s+(\S+?)$', status[3:])
10+
matches = re.search(r'(\S+?)\s+->\s+(\S+?)$', status[3:])
1111
self.original_path = matches.groups()[0]
1212
self.path = matches.groups()[1]
1313
else:

0 commit comments

Comments
 (0)