Skip to content

Commit

Permalink
add @mocha/markdownlint-cli; closes #3172
Browse files Browse the repository at this point in the history
- forked [markdownlint-cli](https://npm.im/markdownlint-cli) to fix a
  glob-related bug; will abandon our version if/when it's merged
- add `.markdownlint.json` config
- remove "allow trailing spaces" for Markdown in `.editorconfig`
- add to `lint` target & create `markdownlint` script in `package.json`,
  which is dumb, but we're stuck with it for now
  • Loading branch information
boneskull committed Dec 29, 2017
1 parent 6c95e34 commit c22aad8
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 18 deletions.
3 changes: 0 additions & 3 deletions .editorconfig
Expand Up @@ -13,6 +13,3 @@ indent_size = 2

[Makefile]
indent_style = tab

[*.md]
trim_trailing_whitespace = false
9 changes: 9 additions & 0 deletions .markdownlint.json
@@ -0,0 +1,9 @@
{
"no-inline-html": false,
"line-length": false,
"no-trailing-punctuation": false,
"no-duplicate-header": false,
"first-header-h1": false,
"first-line-h1": false,
"commands-show-output": false
}
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -35,6 +35,7 @@ clean:
lint:
@printf "==> [Test :: Lint]\n"
npm run lint
npm run markdownlint

test-node: test-bdd test-tdd test-qunit test-exports test-unit test-integration test-jsapi test-compilers test-requires test-reporters test-only test-global-only

Expand Down
2 changes: 1 addition & 1 deletion docs/_includes/backers.md
@@ -1,6 +1,6 @@
## Backers

Find Mocha helpful? Become a [backer](https://opencollective.com/mochajs#support) and support Mocha with a monthly donation.
Find Mocha helpful? Become a [backer](https://opencollective.com/mochajs#support) and support Mocha with a monthly donation.

<!-- markdownlint-disable MD034 -->
{: id="_backers" class="image-list" }
Expand Down
28 changes: 14 additions & 14 deletions docs/index.md
Expand Up @@ -5,9 +5,9 @@ title: 'Mocha - the fun, simple, flexible JavaScript test framework'
Mocha is a feature-rich JavaScript test framework running on [Node.js](https://nodejs.org) and in the browser, making asynchronous testing *simple* and *fun*. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases. Hosted on [GitHub](https://github.com/mochajs/mocha).

<nav class="badges">
[![Gitter](/images/join-chat.svg)](https://gitter.im/mochajs/mocha)
[![OpenCollective](//opencollective.com/mochajs/backers/badge.svg)](#backers)
[![OpenCollective](//opencollective.com/mochajs/sponsors/badge.svg)](#sponsors)
<a href="https://gitter.im/mochajs/mocha"><img src="/images/join-chat.svg" alt="Gitter"></a>
<a href="#backers"><img src="//opencollective.com/mochajs/backers/badge.svg" alt="OpenCollective backers"></a>
<a href="#sponsors"><img src="//opencollective.com/mochajs/sponsors/badge.svg" alt="OpenCollective sponsors"></a>
</nav>

{% include backers.md %}
Expand All @@ -25,17 +25,17 @@ Mocha is a feature-rich JavaScript test framework running on [Node.js](https://n
- [maps uncaught exceptions to the correct test case](#browser-specific-methods)
- [async test timeout support](#delayed-root-suite)
- [test retry support](#retry-tests)
- [test-specific timeouts](#test-level)
- [test-specific timeouts](#test-level)
- [growl notification support](#mochaopts)
- [reports test durations](#test-duration)
- [highlights slow tests](#dot-matrix)
- [file watcher support](#min)
- [global variable leak detection](#--check-leaks)
- [optionally run tests that match a regexp](#-g---grep-pattern)
- [file watcher support](#min)
- [global variable leak detection](#--check-leaks)
- [optionally run tests that match a regexp](#-g---grep-pattern)
- [auto-exit to prevent "hanging" with an active loop](#--exit----no-exit)
- [easily meta-generate suites](#markdown) & [test-cases](#list)
- [mocha.opts file support](#mochaopts)
- clickable suite titles to filter test execution
- clickable suite titles to filter test execution
- [node debugger support](#-d---debug)
- detects multiple calls to `done()`
- [use any assertion library you want](#assertions)
Expand Down Expand Up @@ -297,7 +297,7 @@ describe('hooks', function() {
});
```

> Tests can appear before, after, or interspersed with your hooks. Hooks will run in the order they are defined, as appropriate; all `before()` hooks run (once), then any `beforeEach()` hooks, tests, any `afterEach()` hooks, and finally `after()` hooks (once).
> Tests can appear before, after, or interspersed with your hooks. Hooks will run in the order they are defined, as appropriate; all `before()` hooks run (once), then any `beforeEach()` hooks, tests, any `afterEach()` hooks, and finally `after()` hooks (once).
### Describing Hooks

Expand Down Expand Up @@ -529,9 +529,9 @@ it('should only test in the correct environment', function() {
});
```

The above test will be reported as [pending](#pending-tests). It's also important to note that calling `this.skip()` will effectively *abort* the test.
The above test will be reported as [pending](#pending-tests). It's also important to note that calling `this.skip()` will effectively *abort* the test.

> *Best practice*: To avoid confusion, do not execute further instructions in a test or hook after calling `this.skip()`.
> *Best practice*: To avoid confusion, do not execute further instructions in a test or hook after calling `this.skip()`.
Contrast the above test with the following code:

Expand Down Expand Up @@ -1111,9 +1111,9 @@ The SuperAgent request library [test documentation](https://visionmedia.github.i

```makefile
test-docs:
$(MAKE) test REPORTER=doc \
| cat docs/head.html - docs/tail.html \
> docs/test.html
$(MAKE) test REPORTER=doc \
| cat docs/head.html - docs/tail.html \
> docs/test.html
```

View the entire [Makefile](https://github.com/visionmedia/superagent/blob/master/Makefile) for reference.
Expand Down
139 changes: 139 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -300,6 +300,7 @@
},
"scripts": {
"lint": "eslint . bin/*",
"markdownlint": "markdownlint \"*.md\" \"docs/**/*.md\" \".github/*.md\"",
"test": "make clean && make test",
"prepublishOnly": "npm test && make clean && make mocha.js",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
Expand All @@ -322,6 +323,7 @@
"supports-color": "4.4.0"
},
"devDependencies": {
"@mocha/markdownlint-cli": "^1.0.0",
"assert": "^1.4.1",
"assetgraph-builder": "^5.6.4",
"browserify": "^14.4.0",
Expand Down

0 comments on commit c22aad8

Please sign in to comment.