Closed bplv112 closed 1 year ago
Thanks! So it sounds like there's two related but separate suggestions here that I'll try to summarize. Let me know if this sounds right.
PHPCS
env variable is not set, and there is a vendor/bin
directory in the current directory which contains a phpcs
executable, use that instead of assuming phpcs
is in the PATH.--phpcs=./vendor/bin/phpcs
which overrides the PHPCS
env variable.Number 1 sounds like a great idea!
As for number 2, that would also be fairly easy to do. Just out of curiosity, what would be the UX difference between commands like PHPCS=./vendor/bin/phpcs phpcs-changed --git file.php
and phpcs-changed --phpcs=./vendor/bin/phpcs --git file.php
? Is it easier to do the latter in some situation that I'm not thinking of?
Thank you!
I feel like phpcs-changed --phpcs=./vendor/bin/phpcs --git file.php
would be easier for me personally to use and that's what I feel could be easier in general as well since it will be mentioned on the command help and on the documentation.
Number 2 (adding options for overriding paths) will be fixed by https://github.com/sirbrillig/phpcs-changed/pull/79
Number 1 (phpcs vendor auto-detection) will be fixed by https://github.com/sirbrillig/phpcs-changed/pull/81
https://github.com/sirbrillig/phpcs-changed/releases/tag/v2.11.0-beta.1 should include both of these changes. I'll do a full release when I'm sure that I haven't broken anything. If you have a chance to try it out, @bplv112, let me know!
I'll start off by mentioning that this package has made my life drastically easier. So THANK YOU for that.
I was using this package for bitbucket pipelines and I realized that instead of looking for phpcs in the vendor directory it searches for a global executable. I saw that we could fix this using PHPCS env var but can we simplify this by making it check vendor folder first and then look for the executable globally?
Or could we add a new parameter where we can add phpcs executable path. Its probably subjective because I hate touching env vars ( ironic I know ) but this would definitely simplify the usage.
Again, thank you for the package, love the work! <3