Skip to content

Commit

Permalink
chore: Further markdown linting (dequelabs#848)
Browse files Browse the repository at this point in the history
* chore(markdownlint): Fix MD040 Fenced code blocks should have a language

Removed fence from "Breaking Change since it didn't seem like code

* chore(markdownlint): Fix MD030 Spaces after list markers

* chore(markdownlint): Fix MD012 Multiple consecutive blank lines

* chore(markdownlint): Fix MD007 Unordered list indentation

* chore(markdownlint): Fix MD010 Hard tabs

Modified the EditorConfig file to enforce this in Markdown files too

* chore(markdownlint): Fix MD022 Headers should be surrounded byblank line
  • Loading branch information
nschonni authored and WilcoFiers committed May 3, 2018
1 parent e7a8bf0 commit 5644b95
Show file tree
Hide file tree
Showing 11 changed files with 446 additions and 463 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ indent_size = 2
[*.yml]
indent_style = space
indent_size = 2

[*.md]
indent_style = space
indent_size = 2
9 changes: 4 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## PR Checklist

Please check if your PR fulfills the following requirements:

- [ ] The commit message(s) follow our guidelines: https://github.com/dequelabs/axe-core/blob/develop/doc/code-submission-guidelines.md#git-commits
Expand All @@ -8,14 +9,12 @@ Please check if your PR fulfills the following requirements:
- [ ] Docs have been added / updated (for bug fixes / features)

## Description of the changes
- Github issue:

- Github issue:

## Does this PR introduce a breaking change?
```
[ ] Yes
[ ] No
```

- [ ] Yes
- [ ] No

## Other information
6 changes: 0 additions & 6 deletions .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,15 @@
"MD002": false,
"MD004": false,
"MD006": false,
"MD007": false,
"MD009": false,
"MD010": false,
"MD012": false,
"MD013": false,
"MD022": false,
"MD024": false,
"MD026": false,
"MD029": false,
"MD030": false,
"MD031": false,
"MD032": false,
"MD033": false,
"MD034": false,
"MD036": false,
"MD040": false,
"MD041": false
}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ aXe is the third generation of accessibility rules for HTML-based user interface

First download the package:

```
```console
npm install axe-core --save-dev
```

Expand All @@ -57,12 +57,13 @@ Now insert calls at each point in your tests where a new piece of UI becomes vis

```js
axe.run(function (err, results) {
if (err) throw err;
if (err) throw err;
ok(results.violations.length === 0, 'Should be no accessibility issues');
// complete the async call
...
});
```

## Supported Browsers

The [aXe API](doc/API.md) fully supports the following browsers:
Expand Down
518 changes: 254 additions & 264 deletions doc/API.md

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion doc/accessibility-supported.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ In addition, we disallow invalid attributes starting with `aria-` and invalid at
We recognize that there are best practices that significantly improve the usability of application, even though they are not strictly required in order to conform with WCAG 2. We develop the best practice rules to help content developers to identify these and adhere to them.

We recognize that this topic is somewhat controvertial and the rules we have represent Deque's opinion on what constitutes a best practice.

11 changes: 5 additions & 6 deletions doc/code-submission-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ A detailed explanation of Angular's guidelines and conventions can be found [on
Each commit message should consist of a header, a body and a footer. The header has a special format
that includes a type, a scope and a subject. Here's a sample of the format:

```
```html
<type>(<scope>): <subject>
<BLANK LINE>
<body>
Expand All @@ -35,7 +35,7 @@ that includes a type, a scope and a subject. Here's a sample of the format:
```sh
perf(rule): improve speed of color contrast rules

Use async process to compare elements without UI lockup
Use async process to compare elements without UI lockup

Closes #1
```
Expand Down Expand Up @@ -70,7 +70,6 @@ If the scope is too broad to summarize, use the type only and leave off the pare
`type: some subject`. Keep in mind that a long scope often pushes your commit message over 100 characters.
Brevity is helpful for everyone!


#### Subject

The subject contains succinct description of the change:
Expand Down Expand Up @@ -124,7 +123,7 @@ git checkout -b temp-feature-branch

Run the following commands to apply all commits from that pull request on top of your branch's local history:

```
```console
curl -L https://github.com/dequelabs/axe-core/pull/205.patch | git am -3
```

Expand All @@ -137,7 +136,7 @@ Before merging a pull request with many commits into develop, make sure there is
changes in the pull request, so the git log stays lean. We particularly want to avoid merge messages and vague commits that don't follow our commit policy (like `Merged develop into featurebranch` or `fixed some stuff`).

You can use git's interactive rebase to manipulate, merge, and rename commits in your local
history. If these steps are followed, a force push shouldn't be necessary.
history. If these steps are followed, a force push shouldn't be necessary.

**Do not force push to develop or master under any circulstances.**

Expand All @@ -161,7 +160,7 @@ git pull --rebase origin develop
```

You can then push the latest code to develop (note that force push isn't needed if these steps are followed):
```
```console
git push origin develop
```

Expand Down
77 changes: 37 additions & 40 deletions doc/developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ aXe 3.0 supports open Shadow DOM: see our virtual DOM APIs and test utilities fo

1. [Getting Started](#getting-started)
1. [Architecture Overview](#architecture-overview)
1. [Rules](#rules)
1. [Checks](#checks)
1. [Common Functions](#common-functions)
1. [Virtual Nodes](#virtual-nodes)
1. [Core Utilities](#core-utilities)
1. [Rules](#rules)
1. [Checks](#checks)
1. [Common Functions](#common-functions)
1. [Virtual Nodes](#virtual-nodes)
1. [Core Utilities](#core-utilities)
1. [Virtual DOM APIs](#virtual-dom-apis)
1. [API Name: axe.utils.getFlattenedTree](#api-name-axeutilsgetflattenedtree)
1. [API Name: axe.utils.getNodeFromTree](#api-name-axeutilsgetnodefromtree)
1. [API Name: axe.utils.getFlattenedTree](#api-name-axeutilsgetflattenedtree)
1. [API Name: axe.utils.getNodeFromTree](#api-name-axeutilsgetnodefromtree)
1. [Test Utilities](#test-utilities)
1. [Test Util Name: axe.testUtils.MockCheckContext](#test-util-name-axetestutilsmockcheckcontext)
1. [Test Util Name: axe.testUtils.shadowSupport](#test-util-name-axetestutilsshadowsupport)
1. [Test Util Name: axe.testUtils.fixtureSetup](#test-util-name-axetestutilsfixturesetup)
1. [Test Util Name: axe.testUtils.checkSetup](#test-util-name-axetestutilschecksetup)
1. [Test Util Name: axe.testUtils.MockCheckContext](#test-util-name-axetestutilsmockcheckcontext)
1. [Test Util Name: axe.testUtils.shadowSupport](#test-util-name-axetestutilsshadowsupport)
1. [Test Util Name: axe.testUtils.fixtureSetup](#test-util-name-axetestutilsfixturesetup)
1. [Test Util Name: axe.testUtils.checkSetup](#test-util-name-axetestutilschecksetup)

## Getting Started

### Environment Pre-requisites

1. You must have NodeJS installed.
2. Grunt must be installed globally. `npm install -g grunt-cli` (You may need to do this as `sudo npm install -g grunt-cli`)
3. Install npm development dependencies. In the root folder of your axe-core repository, run `npm install`
1. You must have NodeJS installed.
2. Grunt must be installed globally. `npm install -g grunt-cli` (You may need to do this as `sudo npm install -g grunt-cli`)
3. Install npm development dependencies. In the root folder of your axe-core repository, run `npm install`

### Building axe.js

Expand All @@ -38,12 +38,11 @@ To run all tests from the command line you can run `grunt test`, which will run

You can also load tests in any supported browser, which is helpful for debugging. Tests require a local server to run, you must first start a local server to serve files. You can use Grunt to start one by running `grunt dev`. Once your local server is running you can load the following pages in any browser to run tests:


1. [Core Tests](../test/core/)
2. [Commons Tests](../test/commons/)
3. [Check Tests](../test/checks/)
4. [Integration Tests](../test/integration/rules/)
5. There are additional tests located in [test/integration/full/](../test/integration/full/) for tests that need to be run against their own document.
1. [Core Tests](../test/core/)
2. [Commons Tests](../test/commons/)
3. [Check Tests](../test/checks/)
4. [Integration Tests](../test/integration/rules/)
5. There are additional tests located in [test/integration/full/](../test/integration/full/) for tests that need to be run against their own document.

## Architecture Overview

Expand All @@ -53,7 +52,6 @@ Upon execution, a Rule runs each of its Checks against all relevant nodes. Which

After execution, a Check will return `true` or `false` depending on whether or not the tested condition was satisfied. The result, as well as more information on what caused the Check to pass or fail, will be stored in either the `passes` array or the `violations` array.


### Rules

Rules are defined by JSON files in the [lib/rules directory](../lib/rules). The JSON object is used to seed the [Rule object](../lib/core/base/rule.js#L30). A valid Rule JSON consists of the following:
Expand All @@ -66,9 +64,9 @@ Rules are defined by JSON files in the [lib/rules directory](../lib/rules). The
* `matches` - **optional** `String` Relative path to the JavaScript file of a custom matching function. See [matches function](#matches-function) for more information.
* `tags` - **optional** `Array` Strings of the accessibility guidelines of which the Rule applies.
* `metadata` - `Object` Consisting of:
* `description` - `String` Text string that describes what the rule does.
* `helpUrl` - `String` **optional** URL that provides more information about the specifics of the violation. Links to a page on the Deque University site.
* `help` - `String` Help text that describes the test that was performed.
* `description` - `String` Text string that describes what the rule does.
* `helpUrl` - `String` **optional** URL that provides more information about the specifics of the violation. Links to a page on the Deque University site.
* `help` - `String` Help text that describes the test that was performed.
* `any` - `Array` Checks that make up this Rule; one of these checks must return `true` for a Rule to pass.
* `all` - `Array` Checks that make up this Rule; all these checks must return `true` for a Rule to pass.
* `none` - `Array` Checks that make up this Rule; none of these checks must return `true` for a Rule to pass.
Expand Down Expand Up @@ -97,11 +95,11 @@ Similar to Rules, Checks are defined by JSON files in the [lib/checks directory]
* `after` - **optional** `String` Relative path to the JavaScript file which contains the function body of a Check's after (or post-processing) function.f
* `options` - **optional** `Mixed` Any information the Check needs that you might need to customize and/or is locale specific. Options can be overridden at runtime (with the options parameter) or config-time. For example, the [valid-lang](../lib/checks/language/valid-lang.json) Check defines what ISO 639-1 language codes it should accept as valid. Options do not need to follow any specific format or type; it is up to the author of a Check to determine the most appropriate format.
* `metadata` - `Object` Consisting of:
* `impact` - `String` (one of `minor`, `moderate`, `serious`, or `critical`)
* `messages` - `Object` These messages are displayed when the Check passes or fails
* `pass` - `String` [doT.js](http://olado.github.io/doT/) template string displayed when the Check passes
* `fail` - `String` [doT.js](http://olado.github.io/doT/) template string displayed when the Check fails
* `incomplete` – `String|Object` – [doT.js](http://olado.github.io/doT/) template string displayed when the Check is incomplete OR an object with `missingData` on why it returned incomplete. Refer to [rules.md](./rules.md).
* `impact` - `String` (one of `minor`, `moderate`, `serious`, or `critical`)
* `messages` - `Object` These messages are displayed when the Check passes or fails
* `pass` - `String` [doT.js](http://olado.github.io/doT/) template string displayed when the Check passes
* `fail` - `String` [doT.js](http://olado.github.io/doT/) template string displayed when the Check fails
* `incomplete``String|Object`[doT.js](http://olado.github.io/doT/) template string displayed when the Check is incomplete OR an object with `missingData` on why it returned incomplete. Refer to [rules.md](./rules.md).

#### Check `evaluate`

Expand Down Expand Up @@ -132,11 +130,11 @@ The after function must return an `Array` of CheckResults, due to this, it is a
```javascript
var uniqueIds = [];
return results.filter(function (r) {
if (uniqueIds.indexOf(r.data) === -1) {
uniqueIds.push(r.data);
return true;
}
return false;
if (uniqueIds.indexOf(r.data) === -1) {
uniqueIds.push(r.data);
return true;
}
return false;
});
```

Expand Down Expand Up @@ -245,12 +243,11 @@ The queue function creates an asynchronous "queue", list of functions to be invo
* `then(callback)` The callback to execute once all "deferred" functions have completed. Will only be invoked once.
* `abort()` Abort the "queue" and prevent `then` function from firing


#### DqElement Class

The DqElement is a "serialized" `HTMLElement`. It will calculate the CSS selector, grab the source outerHTML and offer an array for storing frame paths. The DqElement class takes the following parameters:
* `Element` - `HTMLElement` The element to serialize
* `Spec` - `Object` Properties to use in place of the element when instantiated on Elements from other frames
* `Element` - `HTMLElement` The element to serialize
* `Spec` - `Object` Properties to use in place of the element when instantiated on Elements from other frames

```javascript
var firstH1 = document.getElementByTagName('h1')[0];
Expand All @@ -263,7 +260,6 @@ Elements returned by the DqElement class have the following methods and properti
* `element` - `DOMNode` The element which this object is based off or the containing frame, used for sorting.
* `toJSON()` - Returns an object containing the selector and source properties


## Virtual DOM APIs

Note: You shouldn’t need the Shadow DOM APIs below unless you’re working on the axe-core
Expand All @@ -286,8 +282,9 @@ axe.utils.getFlattenedTree(element, shadowId)
```

#### Parameters
- `node` – HTMLElement. The current HTML node for which you want a flattened DOM tree.
- `shadowId` – string(optional). ID of the shadow DOM that is the closest shadow ancestor of the node

- `node` – HTMLElement. The current HTML node for which you want a flattened DOM tree.
- `shadowId` – string(optional). ID of the shadow DOM that is the closest shadow ancestor of the node

#### Returns

Expand Down
Loading

0 comments on commit 5644b95

Please sign in to comment.