Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add ability to split md into code snippets, check with cpplint
  • Loading branch information
tkruse committed Apr 24, 2016
commit 41cf08cc4da3235f5a97aac97706fa8b71081887
25 changes: 24 additions & 1 deletion scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ all: \
check-markdown \
check-references \
check-notabs \
cpplint-all \
check-badchars


$(BUILD_DIR):
mkdir -p $(BUILD_DIR)

Expand Down Expand Up @@ -77,6 +77,29 @@ check-badchars: $(SOURCEPATH) $(BUILD_DIR) Makefile
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;



#### Cpplint

.PHONY: cpplint-all
cpplint-all: $(BUILD_DIR)/codeblocks $(BUILD_DIR)/Makefile python/Makefile.in
cd $(BUILD_DIR)/codeblocks; $(MAKE) cpplint-all -k

#### generic makefile for sourceblocks (need to be evaluated after c++ file generation)

$(BUILD_DIR)/Makefile: python/Makefile.in
cp python/Makefile.in $(BUILD_DIR)/codeblocks/Makefile

#### split md file into plain text and code

$(BUILD_DIR)/codeblocks: splitfile

$(BUILD_DIR)/plain.txt: splitfile

.PHONY: splitfile
splitfile: $(SOURCEPATH) ./python/md-split.py
python ./python/md-split.py $(SOURCEPATH) $(BUILD_DIR)/plain.txt $(BUILD_DIR)/codeblocks

#### install npm modules
# install/update npm dependencies defined in file package.json
# requires npm (nodejs package manager)
Expand Down
18 changes: 18 additions & 0 deletions scripts/python/Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.PHONY: default
default: all

.PHONY: all
all: \
cpplint-all

CXX_SRCS := $(wildcard *.cpp)

#### cpplint, check extracted sources using cpplint tool
CXX_LINT := ${CXX_SRCS:.cpp=.lint}

.PHONY: cpplint-all
cpplint-all: $(CXX_LINT)

%.lint: %.cpp
@python ../../python/cpplint.py --verbose=0 --linelength=100 --filter=-legal/copyright,-build/include_order,-build/c++11,-build/namespaces,-readability/inheritance,-readability/function,-readability/casting,-readability/namespace,-readability/alt_tokens,-readability/braces,-readability/fn_size,-whitespace/comments,-whitespace/braces,-whitespace/empty_loop_body,-whitespace/indent,-whitespace/newline,-runtime/explicit,-runtime/arrays,-runtime/int,-runtime/references,-runtime/string,-runtime/operator $< || (cat $< | nl -ba | grep -v 'md-split' && false)

Loading