mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-04 19:26:52 +00:00
Fix mixed-line-endings --fix=... when whole file is a different ending
This commit is contained in:
parent
efdceb4e40
commit
76047f6eef
2 changed files with 12 additions and 1 deletions
|
|
@ -101,3 +101,13 @@ def test_fix_crlf(tmpdir):
|
|||
|
||||
assert ret == 1
|
||||
assert path.read_binary() == b'foo\r\nbar\r\nbaz\r\n'
|
||||
|
||||
|
||||
def test_fix_lf_all_crlf(tmpdir):
|
||||
"""Regression test for #239"""
|
||||
path = tmpdir.join('input.txt')
|
||||
path.write_binary(b'foo\r\nbar\r\n')
|
||||
ret = main(('--fix=lf', path.strpath))
|
||||
|
||||
assert ret == 1
|
||||
assert path.read_binary() == b'foo\nbar\n'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue