Skip to content

Commit 6ba822f

Browse files
author
Andrew Pardoe
committed
Merge branch 'upgrade-checkers' of https://github.com/tkruse/CppCoreGuidelines into tkruse-upgrade-checkers
2 parents 7f51089 + 2333364 commit 6ba822f

File tree

7 files changed

+810
-766
lines changed

7 files changed

+810
-766
lines changed

CppCoreGuidelines.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3337,7 +3337,8 @@ There is not a choice when a set of functions are used to do a semantically equi
33373337

33383338
##### See also
33393339

3340-
[Default arguments for virtual functions](#Rh-virtual-default-arg)
3340+
3341+
[Default arguments for virtual functions](#Rf-virtual-default-arg}
33413342

33423343
##### Enforcement
33433344

scripts/Makefile

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ cpplint-all \
2121
check-badchars
2222

2323
$(BUILD_DIR):
24-
mkdir -p $(BUILD_DIR)
24+
@mkdir -p $(BUILD_DIR)
2525

2626
#### clean: remove all files generated by the productive rules
2727
.PHONY: clean
@@ -36,16 +36,16 @@ distclean:
3636

3737
#### check markdown
3838

39-
## run remark markdown checker based on configuration in .remarkrc
39+
## run remark markdown checker based on configuration in package.json
4040
.PHONY: check-markdown
41-
check-markdown: nodejs/node_modules/remark nodejs/remark/.remarkrc $(SOURCEPATH) $(BUILD_DIR) Makefile
41+
check-markdown: nodejs/node_modules/remark nodejs/package.json $(SOURCEPATH) $(BUILD_DIR) Makefile
4242
## run remark, paste output to temporary file
43-
cd nodejs; ./node_modules/.bin/remark ../$(SOURCEPATH) --no-color -q --config-path ./remark/.remarkrc 1> ../$(BUILD_DIR)/$(SOURCEFILE).fixed --frail
43+
cd nodejs; ./node_modules/.bin/remark ../$(SOURCEPATH) --no-color -q 1> ../$(BUILD_DIR)/$(SOURCEFILE).fixed --frail
4444

4545
## show a diff with changes remark suggests
4646
.PHONY: show-diff
47-
show-diff: nodejs/node_modules/remark nodejs/remark/.remarkrc $(SOURCEPATH) $(BUILD_DIR) Makefile
48-
cd nodejs; ./node_modules/.bin/remark ../$(SOURCEPATH) --no-color -q --config-path ./remark/.remarkrc 1> ../$(BUILD_DIR)/$(SOURCEFILE).fixed
47+
show-diff: nodejs/node_modules/remark nodejs/package.json $(SOURCEPATH) $(BUILD_DIR) Makefile
48+
cd nodejs; ./node_modules/.bin/remark ../$(SOURCEPATH) --no-color -q 1> ../$(BUILD_DIR)/$(SOURCEFILE).fixed
4949
## compare temporary file to original, error and fail with message if differences exist
5050
diff $(SOURCEPATH) $(BUILD_DIR)/$(SOURCEFILE).fixed -u3 || \
5151
(echo "Error: remark found bad markdown syntax, see output above" && false)
@@ -54,28 +54,28 @@ show-diff: nodejs/node_modules/remark nodejs/remark/.remarkrc $(SOURCEPATH) $(BU
5454
.PHONY: check-references
5555
check-references: $(SOURCEPATH) $(BUILD_DIR) Makefile
5656
## check references unique
57-
rm -f $(BUILD_DIR)/$(SOURCEFILE).uniq
58-
grep -oP '(?<=<a name=")[^\"]+' $(SOURCEPATH) | uniq -d > $(BUILD_DIR)/$(SOURCEFILE).uniq
57+
@rm -f $(BUILD_DIR)/$(SOURCEFILE).uniq
58+
@grep -oP '(?<=<a name=")[^\"]+' $(SOURCEPATH) | uniq -d > $(BUILD_DIR)/$(SOURCEFILE).uniq
5959
## check if output has data
60-
if [ -s "build/CppCoreGuidelines.md.uniq" ]; then echo 'Found duplicate anchors:'; cat $(BUILD_DIR)/$(SOURCEFILE).uniq; false; fi
60+
@if [ -s "build/CppCoreGuidelines.md.uniq" ]; then echo 'Found duplicate anchors:'; cat $(BUILD_DIR)/$(SOURCEFILE).uniq; false; fi
6161

6262
.PHONY: check-notabs
6363
check-notabs: $(SOURCEPATH) $(BUILD_DIR) Makefile
6464
# find lines with tabs
6565
# old file still might be around
66-
rm -f $(BUILD_DIR)/CppCoreGuidelines.md.tabs
66+
@rm -f $(BUILD_DIR)/CppCoreGuidelines.md.tabs
6767
# print file, add line numbers, remove tabs from nl tool, grep for remaining tabs, replace with stars
68-
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
69-
if [ -s $(BUILD_DIR)/CppCoreGuidelines.md.tabs ]; then echo 'Warning: Tabs found:'; cat $(BUILD_DIR)/CppCoreGuidelines.md.tabs; false; fi;
68+
@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
69+
@if [ -s $(BUILD_DIR)/CppCoreGuidelines.md.tabs ]; then echo 'Warning: Tabs found:'; cat $(BUILD_DIR)/CppCoreGuidelines.md.tabs; false; fi;
7070

7171
.PHONY: check-badchars
7272
check-badchars: $(SOURCEPATH) $(BUILD_DIR) Makefile
7373
# find lines with tabs
7474
# old file still might be around
75-
rm -f $(BUILD_DIR)/CppCoreGuidelines.md.badchars
75+
@rm -f $(BUILD_DIR)/CppCoreGuidelines.md.badchars
7676
# 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, use straight quotes instead:'; cat $(BUILD_DIR)/CppCoreGuidelines.md.badchars; false; fi;
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, use straight quotes instead:'; cat $(BUILD_DIR)/CppCoreGuidelines.md.badchars; false; fi;
7979

8080

8181

@@ -88,7 +88,7 @@ cpplint-all: $(BUILD_DIR)/codeblocks $(BUILD_DIR)/Makefile python/Makefile.in
8888
#### generic makefile for sourceblocks (need to be evaluated after c++ file generation)
8989

9090
$(BUILD_DIR)/Makefile: python/Makefile.in
91-
cp python/Makefile.in $(BUILD_DIR)/codeblocks/Makefile
91+
@cp python/Makefile.in $(BUILD_DIR)/codeblocks/Makefile
9292

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

@@ -98,7 +98,7 @@ $(BUILD_DIR)/plain.txt: splitfile
9898

9999
.PHONY: splitfile
100100
splitfile: $(SOURCEPATH) ./python/md-split.py
101-
python ./python/md-split.py $(SOURCEPATH) $(BUILD_DIR)/plain.txt $(BUILD_DIR)/codeblocks
101+
@python ./python/md-split.py $(SOURCEPATH) $(BUILD_DIR)/plain.txt $(BUILD_DIR)/codeblocks
102102

103103
#### install npm modules
104104
# install/update npm dependencies defined in file package.json

scripts/nodejs/package.json

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,44 @@
11
{
2-
"name": "CppCoreGuidelinesCheck",
3-
"version": "0.0.0",
4-
"description": "CppCoreGuidelines Check",
5-
"private": true,
6-
"dependencies": {
7-
"remark": "^4.2.0",
8-
"remark-lint": "^3.2.0",
9-
"remark-lint-sentence-newline": "^2.0.0",
10-
"remark-validate-links": "^3.0.0"
11-
}
2+
"name": "CppCoreGuidelinesCheck",
3+
"version": "0.0.0",
4+
"description": "CppCoreGuidelines Check",
5+
"private": true,
6+
"dependencies": {
7+
"remark": "^4.2.2",
8+
"remark-lint": "^4.0.2",
9+
"remark-lint-sentence-newline": "^2.0.0",
10+
"remark-validate-links": "^4.1.0",
11+
"remark-lint-are-links-valid": "^1.0.2"
12+
},
13+
"remarkConfig": {
14+
"plugins": {
15+
"remark-lint": {
16+
"unordered-list-marker-style": "consistent",
17+
"list-item-bullet-indent": false,
18+
"list-item-indent": false,
19+
"list-item-spacing": false,
20+
"no-html": false,
21+
"maximum-line-length": false,
22+
"no-file-name-mixed-case": false,
23+
"heading-increment": false,
24+
"no-multiple-toplevel-headings": false,
25+
"no-consecutive-blank-lines": false,
26+
"maximum-line-length": 9000,
27+
"maximum-heading-length": 300,
28+
"no-heading-punctuation": false,
29+
"no-duplicate-headings": false,
30+
"emphasis-marker": "*",
31+
"no-tabs": false,
32+
"blockquote-indentation": false,
33+
"strong-marker": "*",
34+
"external": ["remark-lint-are-links-valid"]
35+
}
36+
},
37+
"settings": {
38+
"bullet": "*",
39+
"listItemIndent": "1",
40+
"strong": "*",
41+
"emphasis": "*"
42+
}
43+
}
1244
}

scripts/nodejs/remark/.remarkrc

Lines changed: 0 additions & 31 deletions
This file was deleted.

scripts/python/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ CXX_LINT := ${CXX_SRCS:.cpp=.lint}
1414
cpplint-all: $(CXX_LINT)
1515

1616
%.lint: %.cpp
17-
@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)
17+
@python ../../python/cpplint.py --verbose=0 --linelength=100 --filter=-legal/copyright,-build/include_order,-build/c++11,-build/namespaces,-build/class,-build/include,-build/include_subdir,-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)
1818

0 commit comments

Comments
 (0)