You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to ensure all hooks in my plugin are properly documented.
Describe the solution you'd like
From the PHP Documentation Standards. "Both action and filter hooks should be documented on the line immediately preceding the call to do_action() or do_action_ref_array(), or apply_filters() or apply_filters_ref_array()."
I'd like a sniff to check for these documentation blocks before hooks and report if they are not found or if there is missing parameters.
Additional context (optional)
I feel like this may have existed somewhere but can't find it here which seems the most logical place for it to be.
The text was updated successfully, but these errors were encountered:
The issue is valid, but has been reported before. Closing as duplicate of #424
@superdav42 FYI: We are aware that the documentation sniffs currently in use via the WordPress-Docs standard are nowhere near complete and don't cover the docs handbook by a long shot.
This has been a thorn in my side for quite a while now, however the existing sniffs in PHPCS itself don't easily allow for customization and writing completely new sniffs would mean duplicating a lot of logic.
So, I'm working on improving this in PHPCS first via squizlabs/PHP_CodeSniffer#2222 and squizlabs/PHP_CodeSniffer#2189.
Once the PRs addressing those issues have been accepted and released in a new PHPCS version, you can expect the WPCS docs standard/sniffs - including a hook docs sniff - to be greatly improved soon(ish) after.
Is your feature request related to a problem?
I want to ensure all hooks in my plugin are properly documented.
Describe the solution you'd like
From the PHP Documentation Standards. "Both action and filter hooks should be documented on the line immediately preceding the call to do_action() or do_action_ref_array(), or apply_filters() or apply_filters_ref_array()."
I'd like a sniff to check for these documentation blocks before hooks and report if they are not found or if there is missing parameters.
Additional context (optional)
I feel like this may have existed somewhere but can't find it here which seems the most logical place for it to be.
The text was updated successfully, but these errors were encountered: