From 91a731a6f8d688117e12b6e142f18ff6a0b9afe0 Mon Sep 17 00:00:00 2001 From: Thibault Kruse Date: Sun, 17 Apr 2016 18:55:21 +0200 Subject: [PATCH] Remove last 2 tab instances, Flag all tabs as warning breaking travis build --- CppCoreGuidelines.md | 4 ++-- scripts/Makefile | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index f2dfa0b..0ef3e3b 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -5531,7 +5531,7 @@ It's a standard-library requirement. ##### Example, bad template<> - struct hash { // thoroughly bad hash specialization + struct hash { // thoroughly bad hash specialization using result_type = size_t; using argument_type = My_type; @@ -14333,7 +14333,7 @@ The names are mostly ISO standard-library style (lower case and underscore): * `T*` // The `T*` is not an owner, may be null; assumed to be pointing to a single element. * `char*` // A C-style string (a zero-terminated array of characters); may be null. -* `const char*` // A C-style string; may be null. +* `const char*` // A C-style string; may be null. * `T&` // The `T&` is not an owner and can never be a "null reference"; references are always bound to objects. The "raw-pointer" notation (e.g. `int*`) is assumed to have its most common meaning; that is, a pointer points to an object, but does not own it. diff --git a/scripts/Makefile b/scripts/Makefile index e1e569d..527b588 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -15,7 +15,8 @@ default: all .PHONY: all all: \ check-markdown \ -check-references +check-references \ +check-notabs $(BUILD_DIR): @@ -57,6 +58,14 @@ check-references: $(SOURCEPATH) $(BUILD_DIR) Makefile ## check if output has data if [ -s "build/CppCoreGuidelines.md.uniq" ]; then echo 'Found duplicate anchors:'; cat $(BUILD_DIR)/$(SOURCEFILE).uniq; false; fi +.PHONY: check-notabs +check-notabs: $(SOURCEPATH) $(BUILD_DIR) Makefile +# find lines with tabs +# old file still might be around + rm -f $(BUILD_DIR)/CppCoreGuidelines.md.tabs +# print file, add line numbers, remove tabs from nl tool, grep for remaining tabs, replace with stars + 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; #### install npm modules # install/update npm dependencies defined in file package.json