Skip to content

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

License

Notifications You must be signed in to change notification settings

FreshConsulting/FreshConsulting-WCAG-Linter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published