-
I've written a sniff, and I'd like to use it to check a GitHub repository of mine. I don't see any instructions for this in the wiki. Does anyone have a simple example of this I could copy? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
You can check these repos: |
Beta Was this translation helpful? Give feedback.
-
WPCS also has a guide on setting up GH Actions, so you can check it out: https://github.com/WordPress/WordPress-Coding-Standards/wiki/Running-in-GitHub-Actions 👍🏼 |
Beta Was this translation helpful? Give feedback.
-
@james-cnz It's not completely clear what you are asking. If you are asking about setting up CI, then @asispts and @dingo-d both gave good links. However, I wonder if you are asking about how to include the sniff in your ruleset ? Is that your problem ? If so, have a look at the examples in the Annotated Ruleset wiki page. <!--
If you are including sniffs that are not installed, you can
reference the sniff class using an absolute or relative path
instead of using the sniff code.
-->
<rule ref="/path/to/standards/Generic/Sniffs/Commenting/TodoSniff.php"/>
<rule ref="../Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php"/> There is also a wiki page about creating sniffs in a (new) standard, which you may find helpful. One thing to keep in mind - whether you are creating a (new) standard or not, sniffs do have to follow the PHPCS naming conventions (as outlined in the tutorial). Also see: #689 |
Beta Was this translation helpful? Give feedback.
-
Hi @jrfnl, |
Beta Was this translation helpful? Give feedback.
WPCS also has a guide on setting up GH Actions, so you can check it out: https://github.com/WordPress/WordPress-Coding-Standards/wiki/Running-in-GitHub-Actions 👍🏼