Manually exclude Blade files from calls to PHPCS#199
Conversation
…o PHPCS The --dirty option will pass individual files, and since Blade files are filtered out, PHPCS v4 would fail with no file. We're essentially returning early with a success exit code in that case.
tonysm
left a comment
There was a problem hiding this comment.
Looks good to me! We're essentially handling the case where individual files are passed via the --dirty flag, right? Since PHPCS would filter out Blade files, if all the changed files are Blade files, that would result in an empty path list, and V4 would fail when we run on empty paths... if I got it right.
|
@tonysm in the origina lissue, they were passing I can't actually figure out how to trigger the original issue using If i change a view and a PHP file, I get the linting on the PHP file, but it skips the view with no errors. So the only way I could trigger the error they were dealing with was by specifically passing blade files/folders. ./vendor/bin/duster lint resources/views
# or
./vendor/bin/duster lint resources/views/filename.blade.php |
|
@mattstauffer let's give it a shot. Merging it. |
Fixes #198
Issue introduced because of changes to how PHPCS handles the situation of all files being excluded (in PHPCS 3 it was silent, in PHPCS 4 it throws a
DeepExitException).This PR exits before calling PHPCS if the paths provided, once Blade files are filtered out, are empty.