WooCommerce PHPCS sniff throws an error when using @since x.x.x on hooks #235
Labels
priority: low
The issue/PR is low priority—not many people are affected or there’s a workaround, etc.
type: bug
The issue is a confirmed bug.
Milestone
Describe the Bug
We use the
woocommerce/woocommerce-sniffs
package for our PHPCS sniffs. There is one sniff here (WooCommerce.Commenting.CommentHooks.MissingSinceVersionComment
) that will throw an error if a@since
statement is added to a hook doc but doesn't contain a valid value. Can see a failure here: https://github.com/woocommerce/woocommerce-deposits/actions/runs/9649327093/job/26612562501Since we aren't always sure when opening a PR what the final released version will be, we always use
x.x.x
for those statements, which is fine for function, method or parameter statements but will get flagged when using it for hooks. We always update thesex.x.x
statements before a release so I think we can just ignore these particular sniff by adding the following to ourphpcs.xml.dist
file:To Reproduce
See the following PHPCS error on the #615 PR: https://github.com/woocommerce/woocommerce-deposits/actions/runs/9649327093/job/26612562501
Can also check out this branch locally (
fix/586
) and run PHPCS locally to see the failure:The text was updated successfully, but these errors were encountered: