From f9915cbbe23a535e81c8434cd4ab66055bf31f56 Mon Sep 17 00:00:00 2001 From: Morgan Courbet Date: Thu, 20 Jul 2017 20:32:04 +0200 Subject: [PATCH] Remove _check_filenames in mixed_line_ending.py --- pre_commit_hooks/mixed_line_ending.py | 9 --------- tests/mixed_line_ending_test.py | 5 ----- 2 files changed, 14 deletions(-) diff --git a/pre_commit_hooks/mixed_line_ending.py b/pre_commit_hooks/mixed_line_ending.py index 21f6b2f..0beab60 100644 --- a/pre_commit_hooks/mixed_line_ending.py +++ b/pre_commit_hooks/mixed_line_ending.py @@ -1,5 +1,4 @@ import argparse -import os import re import sys @@ -56,8 +55,6 @@ def mixed_line_ending(argv=None): filenames = options['filenames'] fix_option = options['fix'] - _check_filenames(filenames) - if fix_option == MixedLineEndingOption.NO: return _process_no_fix(filenames) elif fix_option == MixedLineEndingOption.AUTO: @@ -92,12 +89,6 @@ def _parse_arguments(argv=None): 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): with open(filename, 'rb') as f: buf = f.read() diff --git a/tests/mixed_line_ending_test.py b/tests/mixed_line_ending_test.py index b2ac90a..9b49b5e 100644 --- a/tests/mixed_line_ending_test.py +++ b/tests/mixed_line_ending_test.py @@ -152,8 +152,3 @@ def test_mixed_line_ending_fix_force_crlf( assert ret == expected_retval assert path.read_binary() == output - - -def test_check_filenames(): - with pytest.raises(IOError): - mixed_line_ending(['/dev/null'])