moodle-local_moodlecheck
moodle-local_moodlecheck copied to clipboard
Follow the agreed policy for file and class phpdoc blocks in 1-artifact files
This is about to implement the new policy agreed @ MDLSITE-2804. Basically:
- In 1-artifact php files (class, interface, trait), normally under
classes
dir, but also out from them. - Verify that a class phpdoc exists and have all the required elements (package, copyright, license + optional category).
- Ensure that the file phpdoc is optional for those files (but validate it if present).
- Other PHP files will continue requiring a file php doc block.
Edited, note to self: Need to verify that this doesn't happen anymore:
lib/classes/oauth2/service/issuer_interface.php.
(#30) Package is not specified for function init. It is also not specified in file-level phpdocs.
(#37) Package is not specified for function create_endpoints. It is also not specified in file-level phpdocs.
(#45) Package is not specified for function discover_endpoints. It is also not specified in file-level phpdocs.
+1
The plugin still raises "Line 17: File-level phpdocs block is not found" for files that follow the new class-only-block style.
Note I've spent some time today with #69 that doesn't implements this completely, but at least it now stops asking for the file phpdoc block when the file is an 1-artifact one (classes, interfaces and traits).
There are more things to do here, but that's one of the specially annoying ones when new files (usually being 1-artifact files) are added.
Ciao :-)
Thanks Eloy. Maybe that would be enough for now to release a new version and start using it in Github actions? It is sad to see code implemented according to latest policy decisions, causing these failures.
Yeah, I created https://github.com/moodlehq/moodle-plugin-ci/pull/88 some days ago to generate a new release there... will send some friendly pings around...
Update, moodle-plugin-ci 3.0.7 is being released right now. So jobs out there should start to automatically pick it soon (includes #69, partial implementation of this).
Ciao :-)