mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-06 12:06:53 +00:00
Remove _check_filenames in mixed_line_ending.py
This commit is contained in:
parent
4d3d8e1831
commit
f9915cbbe2
2 changed files with 0 additions and 14 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
@ -56,8 +55,6 @@ def mixed_line_ending(argv=None):
|
||||||
filenames = options['filenames']
|
filenames = options['filenames']
|
||||||
fix_option = options['fix']
|
fix_option = options['fix']
|
||||||
|
|
||||||
_check_filenames(filenames)
|
|
||||||
|
|
||||||
if fix_option == MixedLineEndingOption.NO:
|
if fix_option == MixedLineEndingOption.NO:
|
||||||
return _process_no_fix(filenames)
|
return _process_no_fix(filenames)
|
||||||
elif fix_option == MixedLineEndingOption.AUTO:
|
elif fix_option == MixedLineEndingOption.AUTO:
|
||||||
|
|
@ -92,12 +89,6 @@ def _parse_arguments(argv=None):
|
||||||
return options
|
return options
|
||||||
|
|
||||||
|
|
||||||
def _check_filenames(filenames):
|
|
||||||
for filename in filenames:
|
|
||||||
if not os.path.isfile(filename):
|
|
||||||
raise IOError('The file "{}" does not exist'.format(filename))
|
|
||||||
|
|
||||||
|
|
||||||
def _detect_line_ending(filename):
|
def _detect_line_ending(filename):
|
||||||
with open(filename, 'rb') as f:
|
with open(filename, 'rb') as f:
|
||||||
buf = f.read()
|
buf = f.read()
|
||||||
|
|
|
||||||
|
|
@ -152,8 +152,3 @@ def test_mixed_line_ending_fix_force_crlf(
|
||||||
|
|
||||||
assert ret == expected_retval
|
assert ret == expected_retval
|
||||||
assert path.read_binary() == output
|
assert path.read_binary() == output
|
||||||
|
|
||||||
|
|
||||||
def test_check_filenames():
|
|
||||||
with pytest.raises(IOError):
|
|
||||||
mixed_line_ending(['/dev/null'])
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue