Run PHP Code Sniffer in pull requests

v0.2.1 2017-10-01 22:31 UTC


A tool to perform code sniffer checks of your pull requests on Github.

How To Install

You can grab a copy of marcelsud/diffcs in either of the following ways:

As a phar (recommended)

You can simply download a pre-compiled and ready-to-use version as a Phar to any directory. Simply download the latest diffcs.phar file from our releases page:

curl -LO
php diffcs.phar --help

Optionally you can install it globally by adding it to your bin folder:

chmod +x diffcs.phar
mv diffcs.phar /usr/local/bin/diffcs

Via composer:

composer global require "marcelsud/diffcs":"dev-master"
sudo ln -nfs ~/.composer/vendor/bin/diffcs /usr/local/bin/diffcs

Via docker:

docker run --rm -it marcelsud/diffcs --help

How To Use

For public repositories:

Run the following command: diffcs <source>/<project> <pull request id>, where:

  • <source> is the corporation/user behind the project;
  • <project> is the project name on Github;
  • <pull request id> is the pull request id, created by Github.


diffcs symfony/symfony 13342

For private repositories:

Authenticate with username and password

Execute following command: diffcs <source>/<project> <pull request id> --github-user=<github username>, where:

  • <github username> is your Github username.
  • the password will be asked afterwards and is only required check private repositories.


diffcs symfony/symfony 13342 --github-user=yourusername

Authenticate with Github token

Execute following command: diffcs <source>/<project> <pull request id> --github-token=<github token>, where:


diffcs symfony/symfony 13342 --github-token=256199c24f9132f84e9bb06271ff65a3176a2f05