mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-31 02:36:52 +00:00
end_of_file_fixer: detect line ending
Instead of writing \n we try to detect the line ending used in the file. We use the first line ending sequence we find.
This commit is contained in:
parent
b0f11fe246
commit
336f2ed6d1
2 changed files with 26 additions and 2 deletions
|
|
@ -21,6 +21,9 @@ TESTS = (
|
|||
(b'foo\r\n\r\n\r\n', 1, b'foo\r\n'),
|
||||
(b'foo\r', 0, b'foo\r'),
|
||||
(b'foo\r\r\r\r', 1, b'foo\r'),
|
||||
(b'foo\r\nbar', 1, b'foo\r\nbar\r\n'),
|
||||
(b'foo\nbar', 1, b'foo\nbar\n'),
|
||||
(b'foo\rbar', 1, b'foo\rbar\r'),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue