Skip to content

Commit 2333364

Browse files
committed
Refactor remark plugin configuration into package.json, add link validation
1 parent 78bac72 commit 2333364

File tree

3 files changed

+47
-46
lines changed

3 files changed

+47
-46
lines changed

scripts/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

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.2",
8-
"remark-lint": "^4.0.2",
9-
"remark-lint-sentence-newline": "^2.0.0",
10-
"remark-validate-links": "^4.1.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.

0 commit comments

Comments
 (0)