10up / phpcs-composer

Official 10up PHPCS rules.
MIT License
48 stars 8 forks source link

Consider requiring @author and @see to classes, methods and functions #26

Closed claytoncollie closed 1 year ago

claytoncollie commented 3 years ago

Is your enhancement related to a problem? Please describe. Coming into a new organization and taking up the mantle on a client project built many years ago is difficult. It is even more difficult when functionality was added or altered without adequate documentation by dozens of developers. My problem is knowing when, why, and by whom a piece of code was added to a project. As WordPress Core and other plugins evolve, client projects will routinely go through code audits. If we have more rorbust documentation, these audits will go faster and more smoothly.

Describe the solution you'd like I would like for the phpcs command to require or at least flag as a warning that the following tags are used on every method and function.

@author --> https://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.author.pkg.html

@see --> https://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.see.pkg.html

Describe alternatives you've considered Flag only as warnings instead of errors.

Use @link instead of @see. They are very similar and the PHP documentor explanation is too vague to find a difference.

https://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.link.pkg.html

claytoncollie commented 1 year ago

Not suitable for default configuration. Will add to my individual project. Closing.