moodle-local_moodlecheck icon indicating copy to clipboard operation
moodle-local_moodlecheck copied to clipboard

Follow the agreed policy for file and class phpdoc blocks in 1-artifact files

Open stronk7 opened this issue 3 years ago • 6 comments

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.

stronk7 avatar Nov 27 '20 10:11 stronk7

+1

The plugin still raises "Line 17: File-level phpdocs block is not found" for files that follow the new class-only-block style.

mudrd8mz avatar Feb 13 '21 16:02 mudrd8mz

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 :-)

stronk7 avatar Feb 16 '21 17:02 stronk7

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.

mudrd8mz avatar Feb 25 '21 12:02 mudrd8mz

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...

stronk7 avatar Feb 25 '21 16:02 stronk7

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 :-)

stronk7 avatar Feb 25 '21 18:02 stronk7