From aaad2755835391025286e36ff7df6b27a7ff82c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matth=C3=A4us=20G=2E=20Chajdas?= Date: Sat, 19 Sep 2020 17:47:45 +0200 Subject: Address review feedback. * Remove || true * Fix docs * Print the first offending file name --- Makefile | 2 +- scripts/check_crlf.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 62a34685..1f8c383d 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ export PYTHONPATH = $(shell echo "$$PYTHONPATH"):$(shell python -c 'import os; p all: clean-pyc check test check: - @$(PYTHON) scripts/check_crlf.py pygments build external || true + @$(PYTHON) scripts/check_crlf.py pygments build external @$(PYTHON) scripts/detect_missing_analyse_text.py || true @pyflakes pygments | grep -v 'but unused' || true @$(PYTHON) scripts/check_sources.py -i build -i dist -i pygments/lexers/_mapping.py \ 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) -- cgit v1.2.1