Updated: Comment #2
Problem/Motivation
The sniffer review was updated to allow {@inheritdoc} in docblocks. However, it is still flagged as an error by the release standards review. It is unacceptable for the Coder module to report errors for code that complies with Drupal coding standards.
Proposed resolution
I have added {@inheritdoc} to the regex for strings that will not be considered code in comments. This fixes the immediate problem. Additional checks are needed to fully check compliance with API documentation and comment standards.
Remaining tasks
- Add a release standards rule to report an error if
{@inheritdoc}appears in an inline comment rather than a docblock comment. - Add a release standards rule to report an error if the comment in which
{@inheritdoc}appears is not a class member description. - Add a release standards rule to report an error if
{@inheritdoc}is not the only line in the docblock. - Fix FunctionCommentSniff.php to report an error if
{@inheritdoc}is not the only line in the docblock. - Move the function comment that contains
{@inheritdoc}along with additional lines from good.php to bad.php.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | coder-inheritdoc-2163269.patch | 959 bytes | darren oh |
Comments
Comment #1
darren ohComment #2
darren ohFixed typos in remaining tasks list.
Comment #3
darren ohClarified that we need additional rules to be added to the release standards review, not additional reviews.
Comment #4
jonathan1055 commentedThanks Darren Oh. This works for me. Scheduler has several {@inheritdoc} and your patch cleans up the incorrect warnings.
For reference I have added as a related issue the original thread in which the policy was discussed and adopted.
Comment #5
darren ohComment #6
darren ohComment #7
jonathan1055 commentedAny chance this can get committed, please? Darren did a good job, this has helped our project, and it's been RTBC for 3 months.
Comment #9
klausiCommitted, thanks!
Coder Review is a bit lagging behind and has been removed from 8.x-2.x. Coder Sniffer is recommended to check your code. But since it also seems this does not hurt either I went ahead and committed it.
Comment #11
jonathan1055 commentedThanks for committing this, it is a great help.
In a similar fashion, could you also consider #1834598: Coder_Review does not recognize @file docblock in .js files and #1984908: "Docblock should be immediately above" - Carriage Return Line Feed problems as these have good patches which really help to remove bogus warning.
Thank you for a great module - very useful indeed.
Jonathan