summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthäus G. Chajdas <dev@anteru.net>2020-09-18 20:23:07 +0200
committerMatthäus G. Chajdas <dev@anteru.net>2020-09-18 20:23:07 +0200
commit353e52d3e5b3bbb722e83ce4f46a8cba1ccdb07b (patch)
treec3f5ed78482ed7cd22e3ffe376d08d5896218c01
parent6a1821e695b63b7c483d647fb3527bd08e961725 (diff)
downloadpygments-git-353e52d3e5b3bbb722e83ce4f46a8cba1ccdb07b.tar.gz
Improve error checking.
* Include the external folder and check that. * Include .bashcomp files. * Use the correct CR/LF on the checker itself.
-rw-r--r--Makefile2
-rw-r--r--scripts/check_crlf.py60
2 files changed, 31 insertions, 31 deletions
diff --git a/Makefile b/Makefile
index 2b838603..62a34685 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 dist || true
+ @$(PYTHON) scripts/check_crlf.py pygments build external || true
@$(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 c2f26ba6..e82a6717 100644
--- a/scripts/check_crlf.py
+++ b/scripts/check_crlf.py
@@ -1,30 +1,30 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-"""
- Checker for line endings
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
- Make sure each Python does not use Windows-style file endings.
-
- :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import sys
-import os
-
-if __name__ == '__main__':
- for directory in sys.argv[1:]:
- if not os.path.exists(directory):
- continue
-
- for root, dirs, files in os.walk(directory):
- for filename in files:
- if not filename.endswith('.py'):
- continue
-
- with open(os.path.join(root, filename), 'rb') as f:
- if b'\r\n' in f.read():
- sys.exit(1)
-
- sys.exit(0)
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+ Checker for line endings
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Make sure each Python does not use Windows-style file endings.
+
+ :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import sys
+import os
+
+if __name__ == '__main__':
+ for directory in sys.argv[1:]:
+ if not os.path.exists(directory):
+ continue
+
+ for root, dirs, files in os.walk(directory):
+ for filename in files:
+ if not filename.endswith('.py') and not filename.endswith('.bashcomp'):
+ continue
+
+ with open(os.path.join(root, filename), 'rb') as f:
+ if b'\r\n' in f.read():
+ sys.exit(1)
+
+ sys.exit(0)