mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-29 18:16:52 +00:00
Report failing filenames when --fix=no in mixed-line-endings
This commit is contained in:
parent
2dbaced650
commit
f3c65bcd20
1 changed files with 7 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue