Skip to content

Commit

Permalink
Merge #42
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
3 people committed Nov 2, 2018
2 parents 83561f3 + e4b3c5e commit 87b75ae
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-r requirements.txt
flake8==3.5.0
flake8==3.6.0
pytest==3.9.3
pytest-cov==2.6.0
62 changes: 31 additions & 31 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def test_run(self, cli_runner, project):

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

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

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

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

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

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

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

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

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

Expand Down Expand Up @@ -398,7 +398,7 @@ def test_plugin(self, cli_runner, project):

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Expand All @@ -520,7 +520,7 @@ def test_unstaged_changes(self, cli_runner, project):
with chdir(project.path):
result = cli_runner.invoke(cli.run)
assert 'You have unstaged changes.' in result.output
assert re.search('Linting.+?\[FAILURE]', result.output)
assert re.search(r'Linting.+?\[FAILURE]', result.output)
assert result.exception
assert result.exit_code == 2
assert project.read('pass.py') == 'x'
Expand All @@ -533,7 +533,7 @@ def test_include_unstaged_changes(self, cli_runner, project):
with chdir(project.path):
result = cli_runner.invoke(cli.run, ['--include-unstaged-changes'])
assert 'You have unstaged changes.' in result.output
assert re.search('Linting.+?\[SUCCESS]', result.output)
assert re.search(r'Linting.+?\[SUCCESS]', result.output)
assert not result.exception
assert result.exit_code == 0
assert project.read('pass.py') == 'x'
Expand All @@ -545,7 +545,7 @@ def test_use_tracked_files(self, cli_runner, project):

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

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

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

Expand Down Expand Up @@ -605,7 +605,7 @@ def test_junit_xml(self, cli_runner, project):

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

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

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

Expand All @@ -652,8 +652,8 @@ def test_use_extended_shortcut(self, cli_runner, project):
with chdir(project.path):
result = cli_runner.invoke(cli.use, ['fix'])
assert '$ therapist run --action lint --fix --include-untracked' in result.output
assert re.search('Linting.+?\[SUCCESS]', result.output)
assert re.search('Modified files:.+?pass.py.+?<- Linting', result.output, flags=re.DOTALL)
assert re.search(r'Linting.+?\[SUCCESS]', result.output)
assert re.search(r'Modified files:.+?pass.py.+?<- Linting', result.output, flags=re.DOTALL)
assert not result.exception
assert result.exit_code == 0
assert project.read('pass.py') == 'FIXED'
Expand All @@ -667,8 +667,8 @@ def test_extend_extended_shortcut(self, cli_runner, project):
with chdir(project.path):
result = cli_runner.invoke(cli.use, ['fix:all'])
assert '$ therapist run --action lint --fix --include-untracked --use-tracked-files' in result.output
assert re.search('Linting.+?\[SUCCESS]', result.output)
assert re.search('Modified files:.+?pass.py.+?<- Linting', result.output, flags=re.DOTALL)
assert re.search(r'Linting.+?\[SUCCESS]', result.output)
assert re.search(r'Modified files:.+?pass.py.+?<- Linting', result.output, flags=re.DOTALL)
assert not result.exception
assert result.exit_code == 0
assert project.read('pass.py') == 'FIXED'
Expand Down Expand Up @@ -783,7 +783,7 @@ def test_hook_with_fix(self, cli_runner, project):
project.git.add('.')

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

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

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

out, err, code = project.git.status(porcelain=True)
Expand Down
8 changes: 4 additions & 4 deletions therapist/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ def run(**kwargs):
if plugin:
try:
processes = [config.plugins.get(plugin)]
except config.plugins.DoesNotExist as err:
output('{}\nAvailable plugins:'.format(err.message))
except config.plugins.DoesNotExist as e:
output('{}\nAvailable plugins:'.format(e.message))

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

for a in config.actions:
output(a.name)
Expand Down
2 changes: 1 addition & 1 deletion therapist/utils/git/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def __init__(self, status):
self.is_modified = status[1] == 'M'

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

0 comments on commit 87b75ae

Please sign in to comment.