New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No longer reading phpcs.xml #1660
Comments
PHPCS definitely still reads phpcs.xml.dist files. That's how I test PHPCS itself: https://github.com/squizlabs/PHP_CodeSniffer/blob/master/phpcs.xml.dist Try running phpcs with the |
I have try with --v and it use default PSR-2 as default. Just rollback to v2.x and it work. |
I'm running a similar config with the same exclude patterns and the exclude-pattern directives are definitely not working as before. 2.x works fine, but Travis CI is of course using the latest phpcs, so my builds are now failing horribly. |
@anhskohbo @nosilver4u Could you each provide links to the repos you are running PHPCS on ? And maybe a link to one of the failed Travis builds ? I'd like to take a look. |
My build is here: https://travis-ci.org/nosilver4u/ewww-image-optimizer/builds/277064437 I found a fix was to change the way I run the phpcs command. Previously, it was run like so In the first case, phpcs would be passed a list of files to validate, potentially breaking the exclude pattern. In the latter, it simply has a directory as the target, and is able to ignore the files that match the exclude-pattern properly. And as I said before, my exclude patterns are identical to those used by anhskohbo. Hope that helps! |
I finally know what is happening here. In your version, if you've told PHPCS that your default standard is PSR2, it will always default to using PSR2. If you haven't told it what standard to use, either via the config or on the command line, it will go searching for a phpcs.xml file. I noticed this and fixed it in the 3.1.0 release via this commit: 2e34a66 If you upgrade to 3.1.0, this will be fixed for you. If you can't upgrade, you could remove the default_standard config setting as a workaround. Closing this issue as I've been able to confirm the problem on 3.0.2 and the fix in 3.1.0 on my own test system. |
I thought I had the standard path wrong but after updating php_codesniffer from composer it started reading phpcs.xml. Ref: squizlabs/PHP_CodeSniffer#1660
I upgrade phpcs 3.0.2 today and see the php no longer read
phpcs.xml.dis
file.Run:
My
phpcs.xml.dist
The text was updated successfully, but these errors were encountered: