Part of meta-issue #1310084: [meta] API documentation cleanup sprint
| Comment | File | Size | Author |
|---|---|---|---|
| #30 | openiddocs-1405948-30.patch | 28.38 KB | sidharthap |
| #30 | openiddocs-1405948-30-interdiff.txt | 4.65 KB | sidharthap |
| #28 | openiddocs-1405948-28.patch | 27.87 KB | albert volkman |
| #23 | interdiff.txt | 6.58 KB | drnikki |
| #23 | openiddocs-1405948-23.patch | 29.66 KB | drnikki |
Comments
Comment #1
geoffreyr commentedComment #2
geoffreyr commentedComment #3
geoffreyr commentedComment #5
geoffreyr commentedComment #6
jhodgdonThanks for the patch! I noticed a couple of things:
a)
Needs to end in ".".
b)
Should not have $identifier there. You can put a data *type* on the @return line (like string, array, boolean, etc.), but not a variable name. This problem occurs several times in the patch.
c)
Spell check -- targeting should only have one T in the middle.
d)
Could use some "the" in there. Also normally we put database table names in {} brackets.
e)
Both param descriptions need to end in "." This problem appears several times in the patch.
f)
The initial description needs to be cut down to one 80-character line. This problem occurs at least a couple of times in the patch.
g)
Try to avoid abbreviations in documentation -- maybe this should be multiply? I'm not sure about this... maybe "mul", "div", "cmp", etc. are OpenID standards -- in which case the technical terms can be used I guess... but I think the docs would be clearer with "multiply", "divide", "compare", etc.
h)
Should start with a verb.
i)
See http://drupal.org/node/1354#forms
j)
Wrong verb tense. Applies to next doc block too.
k)
Implementation of -> Implements
l)
See http://drupal.org/node/1354#menu-callback
m)
See http://drupal.org/node/1354#forms
Comment #7
jhodgdontagging.
Comment #8
Anonymous (not verified) commentedSince there hasn't been activity for 4+ weeks, I'm going to move this back to unassigned.
Comment #10
Zgear commenteda) pretty sure I got all of those
b) replaced most of those with $string, if any of those are still wrong please say so.
c) Easy fix
d) Got that too
e) managed to find all the missing periods (I think)
f) managed to cut down the longer comments but I'm unsure as to wether they are better or not
g) didn't touch this because I was unsure if it was openid terminology or not
h) rewrote the line hopefully for the better
i) removed the @param's because I thought that is what you meant
j) used generates
k) another easy one
for both l) and m), I didn't have the time to get to those so if someone would be willing to finish what I started that would be much apreciated, otherwise I'll take another look at it some other time.
thanks ZenDoodles for the help and thanks jodgdon for the notes.
Comment #11
ZenDoodles commentedComment #13
xjmLooks like it needs to be rerolled. (LearnDrupal.org has a good reference on rerolling if the reroll turns out to be difficult). Could you also provide an interdiff? Thanks @Zgear!
Comment #14
tim.plunkettI tried to reroll it but patch said that it was malformed. Couldn't spot why.
Comment #15
Zgear commentedredid it manually and did a git diff, also fixed the last of the issues with it I believe.
Comment #16
Zgear commentedComment #17
ZenDoodles commentedZgear,
I started to review this, but there are peculiar issues like doc blocks pasted onto the incorrect function. It probably came from manually editing the first patch and/or trying to apply the patch by hand. Let's try again...
See also the awesomeness xjm wrote here: http://xjm.drupalgardens.com/blog/interdiffs-how-make-them-and-why-they-...
Did you paste this badly? Otherwise it needs some rephrasing and at least one more space...
This is probably not in the right place. The result of manually applying a patch perhaps?
Again, probably misplaced.
Comment #18
xjmThere is also a fair chance the original patch will need to be rebased. See this lesson on rerolls on learndrupal.org for detailed instructions.
Comment #19
Zgear commentedAttaching 3 files:
Rebased first patch to apply against current 8.x.
Patch with applied changes from #6.
Interdiff between the two.
Comment #20
Zgear commentedThanks zendoodles for doing most of this, I only did the rebasing part.
Comment #21
jhodgdonThanks for the rebasing work! I took a look at the final patch from #19, and needs some work:
a) openid.inc
Wording is bad here: "...for (for..."
b)
We try to avoid abbreviations like "spec" in docs [this applies to several other places in the patch too!], and anyway what "spec" is this following? The next function in the file refers to this "serialized message packet as per spec" as both a "direct communication message" and a "serialized message" (without the word "packet"). The two functions should use one consistent wording.
Also, there is no space added after \n in the code, so the way this line is written is confusing to me... How about actually putting the information about the return value ($key:$value\n) into the @return section, and making sure it doesn't have a confusing space in it?
c)
This @param needs some "the" etc. added to it so it reads more like English. :)
d)
I don't think the @param doc is correct here. I see what the function is doing, but $str is not passed by reference, so there is no way it will be "populated" in such a way that the calling function can see it, right? It seems like a function bug, but really the $str argument is I think really quite useless...
e)
Needs to be shortened to one 80-character line. If necessary, put additional information into a new paragraph.
f) openid.module now...
- First line should use the form function name, not "the user login form".
- typo -- submint -> submit in the last line... oh, actually I don't think that function exists at all?
- I think this could use an @see to the two user login form alter functions in this file, and they should have an @see here and to the submit function (if there is actually one).
g)
- First line should start with a verb.
- List formatting is not correct here (wrong indent).
- param descriptions should end in .
h)
- First line needs a "the" in there.
- Return section needs rewrapping to near-80-character lines
- We put commas before and/or in a list of items (success, failed, or cancel)
i)
Needs "the"
j)
Remove "of"
k)
Ah finally, someone defined what XRI is! It would be great if this was added to the other places in the docs where XRI is used without defining the acronym. Similar with other acronyms.
l)
- First line needs to start with a verb.
- @return section needs a rewrite. I can't figure it out at all.
m)
attempt -> attempts
n)
See http://drupal.org/node/1354#menu-callback for specs on how to document page callbacks. In particular, do not mention a path specifically.
o)
Needs @see to openid_menu() added.
p)
Remove @see. Redundant with first line.
Comment #22
drnikki commentedHere's a reroll of the one above. Once this passes, I'll upload the comments and an interdiff.
Comment #23
drnikki commentedComment #24
drnikki commentedComment #25
jhodgdon#23: openiddocs-1405948-23.patch queued for re-testing.
Comment #26
jhodgdon(sorry, I'm not finding lots of spare time to review these issues and a patch got committed yesterday that probably conflicts with this one; this one probably needs a reroll)
Comment #28
albert volkman commentedRe-roll.
Comment #29
jhodgdonThis mostly looks pretty good, thanks! I had a couple of concerns:
Starting with openid.inc...
a) I'm wondering about:
This appears in several places in the patch... Do you think the docs for $message are sufficient to tell people what they are? I looked at one of the functions' code, and found it that it needs to be an associative array of name => value, and furthermore that the values are url-encoded by the function. None of this is in the documentation. Also, we might as well make the first line @param string $url (kind of funny to add the type on the $message param but not the $url param).
b)
What is an XRI? I have no idea. Acronym should probably be spelled out (on the theory that if I don't know what it is, probably I'm not the only one). URL and HTML and PHP are acronyms we should all know, but I'm not sure about XRI.
Oh, later in the patch I found this explanation of what an XRI is:
"The Extensible Resource Indicator (XRI) to attempt discovery on." -- let's use that. Wherever XRI appears in function docs, it should first be spelled out within that function doc (and later uses within the same function doc can use the acronym). Or at least *somewhere* in the function doc it should be spelled out (there may not, for instance, be room in the first line of the function).
c) It doesn't look to me as though _openid_nonce() returns an array. I think it's a string?
d) Fix wrapping:
e) We should fix this parameter name -- it's a long but the parameter is called $str. As the function is only one line long, fixing it could be considered a documentation change.
f) Here, the docs do not match the parameter name:
g) Needs to end in .
h) How about saying @return string The name of the math library, either 'gmp' or 'bcmath'. ?
i) Now in openid.module:
Misisng the third parameter here.
j)
Not accurate. The function returns $response, after changing it in various ways.
Comment #30
sidharthapHere is the patch file. I have corrected the file #29 comments. Thanks to @jhodgdon. Please review it.
Comment #31
sidharthapStatus needs review
Comment #32
jhodgdonThese issues are a lot of work with very little tangible payoff, so I'm closing the rest of them as "won't fix". Your efforts on working on this issue were appreciated... it was just my fault for starting a task that was very difficult to get right.
Let's instead put our effort into fixing and reviewing documentation that is really unclear and/or wrong, and I hope that the people who worked on these issues are not afraid to jump into a more reasonable issue!