mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-06 12:06:53 +00:00
Refactor _process_no_fix
This commit is contained in:
parent
d0016c5be3
commit
ba63d1b9db
1 changed files with 3 additions and 6 deletions
|
|
@ -158,7 +158,6 @@ def _detect_line_ending(filename):
|
||||||
def _process_no_fix(filenames):
|
def _process_no_fix(filenames):
|
||||||
logging.info('Checking if the files have mixed line ending.')
|
logging.info('Checking if the files have mixed line ending.')
|
||||||
|
|
||||||
mle_found = False
|
|
||||||
mle_filenames = []
|
mle_filenames = []
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
detect_result = _detect_line_ending(filename)
|
detect_result = _detect_line_ending(filename)
|
||||||
|
|
@ -166,13 +165,11 @@ def _process_no_fix(filenames):
|
||||||
detect_result)
|
detect_result)
|
||||||
|
|
||||||
if detect_result.mle_found:
|
if detect_result.mle_found:
|
||||||
mle_found = True
|
|
||||||
mle_filenames.append(filename)
|
mle_filenames.append(filename)
|
||||||
logging.debug(filename)
|
|
||||||
|
|
||||||
logging.debug(mle_found)
|
mle_found = len(mle_filenames) > 0
|
||||||
logging.debug(str(mle_filenames))
|
|
||||||
if mle_filenames:
|
if mle_found:
|
||||||
logging.info('The following files have mixed line endings:\n\t%s',
|
logging.info('The following files have mixed line endings:\n\t%s',
|
||||||
'\n\t'.join(mle_filenames))
|
'\n\t'.join(mle_filenames))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue