Check for undesired characters

This commit is contained in:
Thibault Kruse 2016-04-18 20:42:52 +02:00
parent 111dcfada1
commit d092b19fc7

View File

@ -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)