Skip to content

Commit

Permalink
Don't exit after the first error in check_crlf.
Browse files Browse the repository at this point in the history
This makes it easier to find all offending files in a commit, instead of
having to only get notified of one file per run.
  • Loading branch information
Anteru committed Aug 6, 2023
1 parent 2d40ac0 commit d7b3732
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/check_crlf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import os

if __name__ == '__main__':
error = False
for directory in sys.argv[1:]:
if not os.path.exists(directory):
continue
Expand All @@ -27,6 +28,9 @@
with open(full_path, 'rb') as f:
if b'\r\n' in f.read():
print('CR/LF found in', full_path)
sys.exit(1)
error = True

if error:
sys.exit(1)

sys.exit(0)

0 comments on commit d7b3732

Please sign in to comment.