Report failing filenames when --fix=no in mixed-line-endings

This commit is contained in:
Andy Gimblett 2018-11-26 10:17:52 +00:00
parent 2dbaced650
commit f3c65bcd20

View file

@ -37,9 +37,15 @@ def fix_filename(filename, fix):
# Some amount of mixed line endings
mixed = sum(bool(x) for x in counts.values()) > 1
if fix == 'no' or (fix == 'auto' and not mixed):
if fix == 'no':
if mixed:
# Not fixing, just report problematic file
print('Mixed line endings: {filename}'.format(filename=filename))
return mixed
if fix == 'auto' and not mixed:
return False
if fix == 'auto':
max_ending = LF
max_lines = 0