diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/check_crlf.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/check_crlf.py b/scripts/check_crlf.py index e82a6717..14442d0e 100644 --- a/scripts/check_crlf.py +++ b/scripts/check_crlf.py @@ -4,7 +4,8 @@ Checker for line endings ~~~~~~~~~~~~~~~~~~~~~~~~ - Make sure each Python does not use Windows-style file endings. + Make sure Python (.py) and Bash completition (.bashcomp) files do not + contain CR/LF newlines. :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. @@ -23,8 +24,10 @@ if __name__ == '__main__': if not filename.endswith('.py') and not filename.endswith('.bashcomp'): continue - with open(os.path.join(root, filename), 'rb') as f: + full_path = os.path.join(root, filename) + with open(full_path, 'rb') as f: if b'\r\n' in f.read(): + print('CR/LF found in', full_path) sys.exit(1) sys.exit(0) |