[wp-trac] [WordPress Trac] #35065: Tests for docblock quality
WordPress Trac
noreply at wordpress.org
Mon Dec 14 01:15:11 UTC 2015
#35065: Tests for docblock quality
------------------------------+-----------------------------
Reporter: johnbillion | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build/Test Tools | Version:
Severity: normal | Keywords:
Focuses: docs |
------------------------------+-----------------------------
Attached is a patch which implements various tests for docblocks in PHP
files. The patch is experimental and is intended only to determine whether
unit tests for docblocks are a good idea or not.
Currently tested for each function/method:
* Existence of docblock.
* Non-emptiness of docblock.
* Correct number of `@param` tags.
Currently tested for each parameter of a function/method:
* Non-emptiness of description.
* Name matches actual parameter name.
* Various type hint validations (not so appropriate for core).
* Existence or not of "Optional" string.
* Existence or not of "Default" string.
Currently this only tests functions/classes which are loaded in the
current scope. [https://github.com/phpDocumentor/Reflection
phpDocumentor's static reflection library] allows static analysis of files
instead of using PHP's built-in Reflection API, which would allow for all
functions and classes to be tested.
cc @DrewAPicture
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35065>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list