View Dockerfile on GitHub.
Tiny Alpine-based multistage-builld dockerized version of phpcs[1]. The image is built nightly against multiple stable versions and pushed to Dockerhub.
[1] Official project: https://github.com/squizlabs/PHP_CodeSniffer
The working directory inside the Docker container is /app/
and should be mounted locally to
the root of your project.
$ docker run --rm -v $(pwd):/app paillechat/docker-phpcs .
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
2 | ERROR | [ ] Missing file doc comment
5 | ERROR | [x] First condition of a multi-line IF statement must
| | directly follow the opening parenthesis
6 | ERROR | [x] Line indented incorrectly; expected at least 4
| | spaces, found 1
6 | ERROR | [x] Closing brace must be on a line by itself
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
Custom standards must be mounted inside the container to /usr/bin/CodeSniffer.conf
# Via command line
$ docker run --rm -v $(pwd):/app -v CodeSniffer.conf:/usr/bin/CodeSniffer.conf paillechat/docker-phpcs .