woocommerce / woocommerce-sniffs

Collection of PHP_CodeSniffer sniffs for WooCommerce
https://packagist.org/packages/woocommerce/woocommerce-sniffs
MIT License
48 stars 10 forks source link

Add Hook `@since` Validation #28

Closed ObliviousHarmony closed 2 years ago

ObliviousHarmony commented 2 years ago

Right now our hook sniff only detects whether or not there is a @since tag. We should go a step further and also validate the version (support unknown or something too), as well as require a description. The validation for the description doesn't need to be robust; it just needs to make sure something is written after whitespace in the @since comment line.

ObliviousHarmony commented 2 years ago

We should also probably validate that a description has been added to the hook itself when a new hook has been added. To avoid the messiness of existing hooks without descriptions, we can perhaps ignore missing descriptions for hooks with @since tags.