From d092b19fc73571a34b0291df69a1f1f1eb07f614 Mon Sep 17 00:00:00 2001 From: Thibault Kruse Date: Mon, 18 Apr 2016 20:42:52 +0200 Subject: [PATCH] Check for undesired characters --- scripts/Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile b/scripts/Makefile index 527b588..7c9b71f 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -16,7 +16,8 @@ default: all all: \ check-markdown \ check-references \ -check-notabs +check-notabs \ +check-badchars $(BUILD_DIR): @@ -67,6 +68,15 @@ check-notabs: $(SOURCEPATH) $(BUILD_DIR) Makefile cat ../CppCoreGuidelines.md | nl -ba | sed -s 's/\(^[^\t]*\)\t/\1--/g' | grep -P '\t' | sed -s 's/\t/\*\*\*\*/g' > $(BUILD_DIR)/CppCoreGuidelines.md.tabs if [ -s $(BUILD_DIR)/CppCoreGuidelines.md.tabs ]; then echo 'Warning: Tabs found:'; cat $(BUILD_DIR)/CppCoreGuidelines.md.tabs; false; fi; +.PHONY: check-badchars +check-badchars: $(SOURCEPATH) $(BUILD_DIR) Makefile +# find lines with tabs +# old file still might be around + rm -f $(BUILD_DIR)/CppCoreGuidelines.md.badchars +# print file, add line numbers, grep for bad chars + cat ../CppCoreGuidelines.md | nl -ba | grep -P '’|‘|”|“|¸|–|…|¦' > $(BUILD_DIR)/CppCoreGuidelines.md.badchars || true + if [ -s $(BUILD_DIR)/CppCoreGuidelines.md.badchars ]; then echo 'Warning: Undesired chars (–’‘“”¸…¦) found:'; cat $(BUILD_DIR)/CppCoreGuidelines.md.badchars; false; fi; + #### install npm modules # install/update npm dependencies defined in file package.json # requires npm (nodejs package manager)