mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-14 16:34:46 +00:00
Open our output file in append mode always
This avoid overwriting portions of our log output when using Flake8 in verbose mode. Closes #193
This commit is contained in:
parent
971dcc16f0
commit
e93aad6043
3 changed files with 10 additions and 4 deletions
|
|
@ -16,12 +16,18 @@
|
||||||
not updated for the current version of flake8. This is nicer than raising a
|
not updated for the current version of flake8. This is nicer than raising a
|
||||||
`PicklingError` about failing to pickle a module (See also `GitLab#164`_)
|
`PicklingError` about failing to pickle a module (See also `GitLab#164`_)
|
||||||
|
|
||||||
|
- Always open our output file in append mode so we do not overwrite log
|
||||||
|
messages. (See also `GitLab#193`_)
|
||||||
|
|
||||||
|
|
||||||
.. links
|
.. links
|
||||||
|
.. _GitLab#164:
|
||||||
|
https://gitlab.com/pycqa/flake8/issues/164
|
||||||
.. _GitLab#178:
|
.. _GitLab#178:
|
||||||
https://gitlab.com/pycqa/flake8/issues/178
|
https://gitlab.com/pycqa/flake8/issues/178
|
||||||
|
.. _GitLab#193:
|
||||||
|
https://gitlab.com/pycqa/flake8/issues/193
|
||||||
.. _GitLab#195:
|
.. _GitLab#195:
|
||||||
https://gitlab.com/pycqa/flake8/issues/195
|
https://gitlab.com/pycqa/flake8/issues/195
|
||||||
.. _this Python bug report:
|
.. _this Python bug report:
|
||||||
https://bugs.python.org/issue27649
|
https://bugs.python.org/issue27649
|
||||||
.. _GitLab#164:
|
|
||||||
https://gitlab.com/pycqa/flake8/issues/164
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ class BaseFormatter(object):
|
||||||
This defaults to initializing :attr:`output_fd` if :attr:`filename`
|
This defaults to initializing :attr:`output_fd` if :attr:`filename`
|
||||||
"""
|
"""
|
||||||
if self.filename:
|
if self.filename:
|
||||||
self.output_fd = open(self.filename, 'w')
|
self.output_fd = open(self.filename, 'a')
|
||||||
|
|
||||||
def handle(self, error):
|
def handle(self, error):
|
||||||
"""Handle an error reported by Flake8.
|
"""Handle an error reported by Flake8.
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ def test_start(filename):
|
||||||
if filename is None:
|
if filename is None:
|
||||||
assert mock_open.called is False
|
assert mock_open.called is False
|
||||||
else:
|
else:
|
||||||
mock_open.assert_called_once_with(filename, 'w')
|
mock_open.assert_called_once_with(filename, 'a')
|
||||||
|
|
||||||
|
|
||||||
def test_stop():
|
def test_stop():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue