Skip to content

Commit d092b19

Browse files
committed
Check for undesired characters
1 parent 111dcfa commit d092b19

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ default: all
1616
all: \
1717
check-markdown \
1818
check-references \
19-
check-notabs
19+
check-notabs \
20+
check-badchars
2021

2122

2223
$(BUILD_DIR):
@@ -67,6 +68,15 @@ check-notabs: $(SOURCEPATH) $(BUILD_DIR) Makefile
6768
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
6869
if [ -s $(BUILD_DIR)/CppCoreGuidelines.md.tabs ]; then echo 'Warning: Tabs found:'; cat $(BUILD_DIR)/CppCoreGuidelines.md.tabs; false; fi;
6970

71+
.PHONY: check-badchars
72+
check-badchars: $(SOURCEPATH) $(BUILD_DIR) Makefile
73+
# find lines with tabs
74+
# old file still might be around
75+
rm -f $(BUILD_DIR)/CppCoreGuidelines.md.badchars
76+
# print file, add line numbers, grep for bad chars
77+
cat ../CppCoreGuidelines.md | nl -ba | grep -P '’|‘|”|“|¸|–|…|¦' > $(BUILD_DIR)/CppCoreGuidelines.md.badchars || true
78+
if [ -s $(BUILD_DIR)/CppCoreGuidelines.md.badchars ]; then echo 'Warning: Undesired chars (–’‘“”¸…¦) found:'; cat $(BUILD_DIR)/CppCoreGuidelines.md.badchars; false; fi;
79+
7080
#### install npm modules
7181
# install/update npm dependencies defined in file package.json
7282
# requires npm (nodejs package manager)

0 commit comments

Comments
 (0)