Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
stronk7 opened this issue Nov 27, 2020 · 6 comments

Comments

@stronk7
Copy link
Member

stronk7 commented Nov 27, 2020

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.

@mudrd8mz
Copy link
Member

+1

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

stronk7 added a commit to stronk7/moodle-local_moodlecheck that referenced this issue Feb 16, 2021
Now we detect all the classes, interfaces and traits in a file
and, if there is only one, then we stop requiring the file
phpdoc block.

This was agreed @ https://tracker.moodle.org/browse/MDLSITE-2804
and moodlehq#66
was created to implement it.

Note this doesn't address the whole agreement, but just the
detail about stop requiring the file phpdoc block, because it
is specially annoying and recurring in new files (that use to
be 1-artifact ones).
@stronk7
Copy link
Member Author

stronk7 commented Feb 16, 2021

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 added a commit to stronk7/moodle-local_moodlecheck that referenced this issue Feb 16, 2021
Now we detect all the classes, interfaces and traits in a file
and, if there is only one, then we stop requiring the file
phpdoc block.

This was agreed @ https://tracker.moodle.org/browse/MDLSITE-2804
and moodlehq#66
was created to implement it.

Note this doesn't address the whole agreement, but just the
detail about stop requiring the file phpdoc block, because it
is specially annoying and recurring in new files (that use to
be 1-artifact ones).
stronk7 added a commit to stronk7/moodle-local_moodlecheck that referenced this issue Feb 16, 2021
Now we detect all the classes, interfaces and traits in a file
and, if there is only one, then we stop requiring the file
phpdoc block.

This was agreed @ https://tracker.moodle.org/browse/MDLSITE-2804
and moodlehq#66
was created to implement it.

Note this doesn't address the whole agreement, but just the
detail about stop requiring the file phpdoc block, because it
is specially annoying and recurring in new files (that use to
be 1-artifact ones).
@mudrd8mz
Copy link
Member

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.

@stronk7
Copy link
Member Author

stronk7 commented Feb 25, 2021

Yeah, I created moodlehq/moodle-plugin-ci#88 some days ago to generate a new release there... will send some friendly pings around...

@stronk7
Copy link
Member Author

stronk7 commented Feb 25, 2021

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

@timhunt
Copy link

timhunt commented Oct 27, 2023

Isn't this now working correctly? Can this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants