Public | Automated Build

Last pushed: 6 months ago
Short Description
Run PHPCS in a docker container
Full Description

gruen/phpcs

PHP Code Sniffer container

Take a look at the phpcs homepage

Usage

The default ENTRYPOINT is phpcs

The default CMD parameters are --standard=PSR2 and /app

without adding anything it will run against the current directory (recursively) against the PSR2 standard

docker run -i \
    --rm \
    -v "$(pwd)":/app \
    --name phpcs_"$(date +%s)" \
    gruen/phpcs

you can override the defaults by passing any of the phpcs options

docker run -i \
    --rm \
    -v "$(pwd)":/app \
    --name phpcs_"$(date +%s)" \
    gruen/phpcs --standard=pear /app/src

You can create an alias with the following

docker run -i --rm \
    -v "$(pwd)":/app \
    --name phpcs_"$(date +%s%N)" \
    gruen/phpcs "$@"

I use the "$(date +%s%N)" to prevent naming
conflicts when running multiple containers simultaneously

Docker Pull Command
Owner
gruen
Source Repository

Comments (0)