Docker image for PHP_CodeSniffer already configured for WordPress Coding Standards.
2.8K
Docker image for PHP_CodeSniffer already configured for WordPress Coding Standards.
# No proxy
docker build --no-cache -t joinville/phpcs-wordpress .
# Under proxy
docker build --no-cache -t joinville/phpcs-wordpress --build-arg "http_proxy=$http_proxy" .
Show the available standards:
$ docker run joinville/phpcs-wordpress phpcs -i
The installed coding standards are MySource, PEAR, PHPCS, Squiz, Zend, PSR2, PSR1, WordPress, WordPress-Extra, WordPress-Docs, WordPress-Core and WordPress-VIP
$
# Check for code standards issues
docker run -v /path/to/php/files/:/scripts/ joinville/phpcs-wordpress phpcs --standard=WordPress-Core /scripts/
# Fix code standards issues
docker run -v /path/to/php/files/:/scripts/ joinville/phpcs-wordpress phpcbf --standard=WordPress-Core /scripts/
# Run PHP_CodeSniffer in our custom WordPress plugin and theme
code_lint:
stage: test
image: joinville/phpcs-wordpress
script:
- phpcs --standard=WordPress-Core wp-content/plugins/my-awesome-plugin
- phpcs --standard=WordPress-Core --ignore=/bootstrap/,/inc/ wp-content/themes/my-awesome-theme
Content type
Unrecognized
Digest
Size
27 MB
Last updated
almost 10 years ago
docker pull joinville/phpcs-wordpress