File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -37,15 +37,9 @@ 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' :
41- if mixed :
42- # Not fixing, just report problematic file
43- print ('Mixed line endings: {filename}' .format (filename = filename ))
40+ if fix == 'no' or (fix == 'auto' and not mixed ):
4441 return mixed
4542
46- if fix == 'auto' and not mixed :
47- return False
48-
4943 if fix == 'auto' :
5044 max_ending = LF
5145 max_lines = 0
@@ -82,7 +76,12 @@ def main(argv=None):
8276
8377 retv = 0
8478 for filename in args .filenames :
85- retv |= fix_filename (filename , args .fix )
79+ if fix_filename (filename , args .fix ):
80+ if args .fix == 'no' :
81+ print ('{}: mixed line endings' .format (filename ))
82+ else :
83+ print ('{}: fixed mixed line endings' .format (filename ))
84+ retv = 1
8685 return retv
8786
8887
You can’t perform that action at this time.
0 commit comments