Add missing has_documentation to MxCommand#167
Conversation
|
Actually, looking at some of the use cases, like unittest https://github.com/graalvm/mx/blob/master/mx_unittest.py#L351 the documentation never makes it into the doc message because the function right now expects the command's doc string to be a format string. I think I have a way to fix this. |
|
Hello JornVernee, thanks for contributing a PR to our project! We use the Oracle Contributor Agreement to make the copyright of contributions clear. We don't have a record of you having signed this yet, based on your email address jornvernee -(at)- users -(dot)- noreply -(dot)- github -(dot)- com. You can sign it at that link. If you think you've already signed it, please comment below and we'll check. |
|
Hi @JornVernee , can you please ensure all your commits are made with your real email address. This will avoid the complaints by the graalvmbot. |
|
@dougxc Ah ok. I purposely stopped adding my emails to the commits since I was getting a lot of recruitment spam. I will add the email with the next commit. |
|
Thanks and sorry to hear about the spam. You'll also need to redo the commit (rebase) that is using the github email address. |
|
Not sure why Travis is choking, I can not reproduce that error on my machine. Is something going on with the CI setup? |
Seems to be an issue with the JDT (eclipse compiler/ECJ) JAR which comes from there: Line 18 in 9c00c2e At least locally this URL works fine. I'm not sure what's going on. Maybe the download got corrupted? |
|
@gilles-duboscq I went to the URL and there seems to be no re-direct to But using |
changed to get_doc function, since that makes use simpler commit right version this time :-) Changed implementation to now return the doc correctly, test with `mx help unittest` typo fix Add command function doc to help message (accidentally removed it earlier) - Only print <no documentation> if there is not usage_msg, doc string or doc function. - Changed implementation slightly to make sure that doc is formatted correctly when some of these are missing
|
@gilles-duboscq Well, I implemented your changes and the travis check is passing as well now. My other PR had the same problem: #172 Is there any way you could re-run the check? Thanks |
|
Also this is changing a line with print so it will definitely conflict with #172. |
|
OK, I'll do that after this is integrated then. Then I can make sure there's no other conflicts or weird diffs with mx/master at that point as well. |
Running
mx help <command>throws'MxCommand' object has no attribute 'has_documentation'.This PR adds that missing function.This PR:
has_documentationwithget_doc, since this simplifies usage.unittestcommand passes a doc function instead of a doc string (and removed extra newlin in doc string)get_docfunction actually returns the documentation string.