-
Notifications
You must be signed in to change notification settings - Fork 9
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
Contribute sniffs upstream #34
Comments
@iandunn I've had a quick look through the repo. Here's some feedback to consider (or disregard, whatever takes your fancy):
|
Thanks for the review and tips! |
Where is the abstract test class documented? I was unable to work out how to use it, so I followed this example: https://payton.codes/2017/12/15/creating-sniffs-for-a-phpcs-standard/#writing-tests
What should I use instead? |
This is an experimental repo. It's fast moving and unstable, and as you've noted has plenty of problems that we have yet to solve. Once we've figured out what's possible and what's useful we definitely will contribute it to WPCS and elsewhere as applicable. Thanks for the notes! |
See: https://github.com/squizlabs/PHP_CodeSniffer/blob/master/tests/Standards/AbstractSniffUnitTest.php or just look at how WPCS tests sniffs. If you can't get this working it may be due to the fact that the whole setup is broken as it doesn't comply with the PHPCS naming conventions and therefore will not work properly as a stand-alone standard. You may want to have a read through the sniff writing tutorial to get a better understanding of the basics: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Coding-Standard-Tutorial
|
Once the custom sniffs are mature, it might be a good idea to contribute them to the WordPress Coding Standards and WPThemeReview projects. They have broad application, and could be useful to many.
cc @jrfnl
The text was updated successfully, but these errors were encountered: