Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Framework for markdown lint testing #46

Merged
merged 1 commit into from
Jul 6, 2016
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*~
*.sw*
node_modules/
remark/
26 changes: 26 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"comment": "See .mdlrc for code explanations.",
"default": true,
"MD001": false,
"MD003": false,
"MD004": false,
"MD005": false,
"MD006": false,
"MD007": false,
"MD009": false,
"MD010": false,
"MD011": false,
"MD012": false,
"MD013": false,
"MD025": false,
"MD029": false,
"MD030": false,
"MD031": false,
"MD032": false,
"MD033": false,
"MD036": false,
"MD037": false,
"MD038": false,
"MD040": false,
"dummy": false
}
24 changes: 24 additions & 0 deletions .mdlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
rules "~MD001,~MD003,~MD004,~MD005,~MD007,~MD009,~MD010,~MD011,~MD012,~MD013,~MD022,~MD025,~MD029,~MD030,~MD031,~MD032,~MD033,~MD036,~MD037"

# MD001 Header levels should only increment by one level at a time
# MD003 Header style
# MD004 Unordered list style
# MD005 Inconsistent indentation for list items at the same level
# MD006 Consider starting bulleted lists at the beginning of the line
# MD007 Unordered list indentation
# MD009 Trailing spaces
# MD011 Reversed link syntax
# MD012 Multiple consecutive blank lines
# MD013 Line length
# MD022 Headers should be surrounded by blank lines
# MD025 Multiple top level headers in the same document
# MD029 Ordered list item prefix
# MD030 Spaces after list markers
# MD031 Fenced code blocks should be surrounded by blank lines
# MD032 Lists should be surrounded by blank lines
# MD033 Inline HTML
# MD036 Emphasis used instead of a header
# MD037 Spaces inside emphasis markers
# MD038 Spaces inside code span elements *
# MD040 Fenced code blocks should have a language specified *
# * = only occurs for markdownlint and/or remark
42 changes: 42 additions & 0 deletions .remarkrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* @fileoverview Local remark configuration.
*/

module.exports = {
"plugins": {
"remark-lint": {
// config common with other tools
"heading-increment": false, // MD001
"heading-style": false, // MD003
"unordered-list-marker-style": false, // MD004
"list-item-content-indent": false, // MD005
"list-item-bullet-indent": false, // MD007
"hard-break-spaces": false, // MD009
"no-tabs": false, // MD010
"no-consecutive-blank-lines": false, // MD012
"maximum-line-length": 250, // MD013
"no-multiple-toplevel-headings": false, // MD025
"list-item-indent": false, // MD030
"no-missing-blank-lines": false, // MD031 & MD032
"no-html": false, // MD033
"no-emphasis-as-heading": false, // MD036
"no-inline-padding": false, // MD037-039
"fenced-code-flag": false, // MD040

// config explicitly stating defaults
"ordered-list-marker-value": "ordered", // MD029

// config for remark-lint only
"no-shortcut-reference-link": false,
"no-undefined-references": false,
"list-item-spacing": false,
"code-block-style": false,
"emphasis-marker": false,
}
},
"settings": {
"bullet": "*",
"emphasis": "_",
"strong": "_",
}
}
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: node_js
node_js: 0.11
install:
- gem install mdl
- npm install -g markdownlint-cli

# Obtain development version of remark
- git clone --depth 1 https://github.com/wooorm/remark $HOME/remark
- cd $HOME/remark
- git show --oneline -s
- npm install lerna
- npm install --production
- npm install remark-validate-links remark-lint
- cd -
script:
- mdl -c ./.mdlrc README.md
- markdownlint -c ./.markdownlint.json README.md
- node $HOME/remark/packages/remark-cli/cli.js --config=./.remarkrc.js --frail --no-stdout -u remark-lint README.md
# Do not fail on the invalid links from issue #3
- node $HOME/remark/packages/remark-cli/cli.js --no-stdout -u remark-validate-links README.md