Skip to content

Commit f3c65bc

Browse files
committed
Report failing filenames when --fix=no in mixed-line-endings
1 parent 2dbaced commit f3c65bc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pre_commit_hooks/mixed_line_ending.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,15 @@ def fix_filename(filename, fix):
3737
# Some amount of mixed line endings
3838
mixed = sum(bool(x) for x in counts.values()) > 1
3939

40-
if fix == 'no' or (fix == 'auto' and not mixed):
40+
if fix == 'no':
41+
if mixed:
42+
# Not fixing, just report problematic file
43+
print('Mixed line endings: {filename}'.format(filename=filename))
4144
return mixed
4245

46+
if fix == 'auto' and not mixed:
47+
return False
48+
4349
if fix == 'auto':
4450
max_ending = LF
4551
max_lines = 0

0 commit comments

Comments
 (0)