Refactor remark plugin configuration into package.json, add link validation

This commit is contained in:
Thibault Kruse 2016-08-16 00:46:13 +02:00
parent 78bac72eaf
commit 2333364047
3 changed files with 47 additions and 46 deletions

View File

@ -36,16 +36,16 @@ distclean:
#### check markdown #### check markdown
## run remark markdown checker based on configuration in .remarkrc ## run remark markdown checker based on configuration in package.json
.PHONY: check-markdown .PHONY: check-markdown
check-markdown: nodejs/node_modules/remark nodejs/remark/.remarkrc $(SOURCEPATH) $(BUILD_DIR) Makefile check-markdown: nodejs/node_modules/remark nodejs/package.json $(SOURCEPATH) $(BUILD_DIR) Makefile
## run remark, paste output to temporary file ## run remark, paste output to temporary file
cd nodejs; ./node_modules/.bin/remark ../$(SOURCEPATH) --no-color -q --config-path ./remark/.remarkrc 1> ../$(BUILD_DIR)/$(SOURCEFILE).fixed --frail cd nodejs; ./node_modules/.bin/remark ../$(SOURCEPATH) --no-color -q 1> ../$(BUILD_DIR)/$(SOURCEFILE).fixed --frail
## show a diff with changes remark suggests ## show a diff with changes remark suggests
.PHONY: show-diff .PHONY: show-diff
show-diff: nodejs/node_modules/remark nodejs/remark/.remarkrc $(SOURCEPATH) $(BUILD_DIR) Makefile show-diff: nodejs/node_modules/remark nodejs/package.json $(SOURCEPATH) $(BUILD_DIR) Makefile
cd nodejs; ./node_modules/.bin/remark ../$(SOURCEPATH) --no-color -q --config-path ./remark/.remarkrc 1> ../$(BUILD_DIR)/$(SOURCEFILE).fixed cd nodejs; ./node_modules/.bin/remark ../$(SOURCEPATH) --no-color -q 1> ../$(BUILD_DIR)/$(SOURCEFILE).fixed
## compare temporary file to original, error and fail with message if differences exist ## compare temporary file to original, error and fail with message if differences exist
diff $(SOURCEPATH) $(BUILD_DIR)/$(SOURCEFILE).fixed -u3 || \ diff $(SOURCEPATH) $(BUILD_DIR)/$(SOURCEFILE).fixed -u3 || \
(echo "Error: remark found bad markdown syntax, see output above" && false) (echo "Error: remark found bad markdown syntax, see output above" && false)

View File

@ -1,12 +1,44 @@
{ {
"name": "CppCoreGuidelinesCheck", "name": "CppCoreGuidelinesCheck",
"version": "0.0.0", "version": "0.0.0",
"description": "CppCoreGuidelines Check", "description": "CppCoreGuidelines Check",
"private": true, "private": true,
"dependencies": { "dependencies": {
"remark": "^4.2.2", "remark": "^4.2.2",
"remark-lint": "^4.0.2", "remark-lint": "^4.0.2",
"remark-lint-sentence-newline": "^2.0.0", "remark-lint-sentence-newline": "^2.0.0",
"remark-validate-links": "^4.1.0" "remark-validate-links": "^4.1.0",
} "remark-lint-are-links-valid": "^1.0.2"
},
"remarkConfig": {
"plugins": {
"remark-lint": {
"unordered-list-marker-style": "consistent",
"list-item-bullet-indent": false,
"list-item-indent": false,
"list-item-spacing": false,
"no-html": false,
"maximum-line-length": false,
"no-file-name-mixed-case": false,
"heading-increment": false,
"no-multiple-toplevel-headings": false,
"no-consecutive-blank-lines": false,
"maximum-line-length": 9000,
"maximum-heading-length": 300,
"no-heading-punctuation": false,
"no-duplicate-headings": false,
"emphasis-marker": "*",
"no-tabs": false,
"blockquote-indentation": false,
"strong-marker": "*",
"external": ["remark-lint-are-links-valid"]
}
},
"settings": {
"bullet": "*",
"listItemIndent": "1",
"strong": "*",
"emphasis": "*"
}
}
} }

View File

@ -1,31 +0,0 @@
{
"plugins": {
"remark-lint": {
"unordered-list-marker-style": "consistent",
"list-item-bullet-indent": false,
"list-item-indent": false,
"list-item-spacing": false,
"no-html": false,
"maximum-line-length": false,
"no-file-name-mixed-case": false,
"heading-increment": false,
"no-multiple-toplevel-headings": false,
"no-consecutive-blank-lines": false,
"maximum-line-length": 9000,
"maximum-heading-length": 300,
"no-heading-punctuation": false,
"no-duplicate-headings": false,
"emphasis-marker": "*",
"no-tabs": false,
"blockquote-indentation": false,
"strong-marker": "*"
}
},
"settings": {
"bullet": "*",
"listItemIndent": "1",
"strong": "*",
"emphasis": "*"
}
}