Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit d22903d

Browse files
JayKidWilcoFiers
authored andcommitted
feat: add flag that enables supplying a list of rules to be skipped during the analysis
* chore: upgrade axe/webdriverjs versions (#35) * chore: upgrade axe/webdriverjs versions axe-core 2.4.1 axe-webdriverjs 1.1.4 * feat: upgrade to axe-webdriverjs@1.1.5 * docs: Add changeling for 1.0.2 * chore: update changelog for 1.1.0 * chore: update changelog to match npm version * fix: package.json & .snyk to reduce vulnerabilities (#39) The following vulnerabilities are fixed with a Snyk patch: - https://snyk.io/vuln/npm:debug:20170905 Latest report for dequelabs/axe-cli: https://snyk.io/test/github/dequelabs/axe-cli * feat: add flag that enables supplying a list of rules to be skipped during the analysis It works in the same way adding a rule/tag does. * doc: add documentation for the new parameter available (--disable) + Also removed an extra "the" in the previous method docu
1 parent 9169ffa commit d22903d

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ program.version(version)
1616
.option('-e, --exclude <list>', 'CSS selector of included elements, comma separated', utils.splitList)
1717
.option('-r, --rules <list>', 'IDs of rules to run, comma separated', utils.splitList)
1818
.option('-t, --tags <list>', 'Tags of rules to run, comma separated', utils.splitList)
19+
.option('-l, --disable <list>', 'IDs of rules to disable, comma separated', utils.splitList)
1920
.option('-b, --browser [browser-name]', 'Which browser to run (Webdriver required)')
2021
.option('-s, --save [filename]', 'Save the output as a JSON file. Filename is optional')
2122
.option('-d, --dir <path>', 'Output directory')

lib/axe-test-urls.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ function testPages(urls, config, events) {
6767
} else if (config.rules) {
6868
axe.withRules(config.rules)
6969
}
70+
if (config.disable) {
71+
axe.disableRules(config.disable)
72+
}
7073
if (config.timer) {
7174
console.time('axe-core execution time');
7275
}

readme.MD

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ You can run multiple pages at once, simply add more URLs to the command. If you
2828

2929
## Running specific rules
3030

31-
You can use the `--rules` flag to set which rules you wish to run, or you can use the `--tags` to tell axe to run all rules that have that specific tag. For example:
31+
You can use the `--rules` flag to set which rules you wish to run, or you can use `--tags` to tell axe to run all rules that have that specific tag. For example:
3232

3333
axe www.deque.com --rules color-contrast,html-has-lang
3434

@@ -37,6 +37,12 @@ Or, to run all wcag2a rules:
3737
axe www.deque.com --tags wcag2a
3838

3939

40+
In case you want to disable some rules, you can use `--disable` followed by a list of rules. These will be skipped when analyzing the site:
41+
42+
axe www.deque.com --disable color-contrast
43+
44+
This option can be combined with either `--tags` or `--rules`.
45+
4046
A list of rules and what tags they have is available at: https://dequeuniversity.com/rules/worldspace/2.0/.
4147

4248
## Saving the results

0 commit comments

Comments
 (0)