Skip to content

Latest commit

 

History

History
35 lines (16 loc) · 904 Bytes

README.md

File metadata and controls

35 lines (16 loc) · 904 Bytes

Fresh Consulting WCAG 2.0 Linter

A PHP_CodeSniffer custom rule (sniff) to detect obvious WCAG 2.0 accessibility violations.

There are many violations which are not caught but the ability to detect some is better than none.

Installation

Requires PHPCS 3.x.

Clone this repository:

git clone https://github.com/FreshConsulting/FreshConsulting-WCAG-Linter.git wcag

Add the repository path to the PHP_CodeSniffer configuration:

phpcs --config-set installed_paths /path/to/wcag

Use

Add the sniff to your custom ruleset:

<rule ref="FreshConsulting.WCAG20.Violations"/>

Or run from the command line:

phpcs --sniffs=FreshConsulting.WCAG20.Violations /path/to/code

Testing

Run unit tests with phpunit Test/AllTests or PHPCS_DIR=/path/to/PHP_CodeSniffer phpunit Test/AllTests.