The phpcs-changed's git support works really well when it comes to linting work in progress, however I struggled with making it work in CI, travis specifically.
The issue with travis is that it leaves the working directory in clean state after checkout.
Travis CI branch build:
$ git clone --depth=50 --branch=test/travis https://github.com/david-binda/liveblog.git david-binda/liveblog
$ cd david-binda/liveblog
$ git checkout -qf 16b11e099940ea65e233ec6be6256ddf9588c3ea
$ git status
HEAD detached at 16b11e0
nothing to commit, working directory clean
Travis CI Pull Request build:
$ git clone --depth=50 https://github.com/david-binda/liveblog.git david-binda/liveblog
$ cd david-binda/liveblog
$ git fetch origin +refs/pull/3/merge:
$ git checkout -qf FETCH_HEAD
$ git status
HEAD detached at FETCH_HEAD
nothing to commit, working directory clean
As the working directory, in both cases, is clean, we can't use either of the the git modes (stashed/unstashed) currently supported by phpcs-changed.
From my point of view, a support for making the phpcs-changed to work on diffs across git branches might be enough to accommodate the needs of Travis / CI intergrations.
I believe that adding a param which would indicate against which branch the diff of current copy of a file should be taken would be enough for making the travis work in both cases.
The phpcs-changed's git support works really well when it comes to linting work in progress, however I struggled with making it work in CI, travis specifically.
The issue with travis is that it leaves the working directory in clean state after checkout.
Travis CI branch build:
Travis CI Pull Request build:
As the working directory, in both cases, is clean, we can't use either of the the git modes (stashed/unstashed) currently supported by phpcs-changed.
From my point of view, a support for making the phpcs-changed to work on diffs across git branches might be enough to accommodate the needs of Travis / CI intergrations.
I believe that adding a param which would indicate against which branch the diff of current copy of a file should be taken would be enough for making the travis work in both cases.