Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Part of meta-issue #1310084: [meta] API documentation cleanup sprint
Proposed resolution
Correct the following in the core system module:
- Ensure that all
@return
lines are preceded by a blank line. - Ensure that
@see
and@ingroup
lines are always at the end of docblocks. - Ensure that all lines in doxygen blocks are 80 characters or fewer (excluding the terminal newline).
- Ensure that all functions, classes, interfaces, and methods have one-line summaries that are clear, use the correct verb tense, and follow specific standards in http://drupal.org/node/1354.
- Make incidental style and grammar corrections only to those docblocks already being updated.
Remaining tasks
Patch needs to be rolled.
User interface changes
None.
API changes
None.
Follow-up issues
Comment | File | Size | Author |
---|---|---|---|
#96 | 1326664-96-system-docs.patch | 62.98 KB | Lars Toomre |
#91 | 1326664-91-system-docs.patch | 62.89 KB | Lars Toomre |
#88 | 1326664-88-system-docs.patch | 59.65 KB | Lars Toomre |
#85 | 1326664-85-system-docs.patch | 13.42 KB | Lars Toomre |
#85 | interdiff-1326664-82-85.txt | 1.4 KB | Lars Toomre |
Comments
Comment #1
jhodgdonDo you plan to patch this module? If so can you assign the issue to yourself and also add your name to the summary issue? Thanks!
Comment #2
xjmProposed text for the lease time parameter in
SystemQueue::claimItem()
andMemoryQueue::claimItem()
.Comment #3
sven.lauer CreditAttribution: sven.lauer commentedComment #4
sven.lauer CreditAttribution: sven.lauer commentedHere is a patch.
Given how humungous this patch is, I mostly focussed on fixing formal coding standards issues (i.e. I only tried to fix existing language to a very limited extent).
Comment #5
sven.lauer CreditAttribution: sven.lauer commentedComment #6
xjmI'm with you on the minimal changes because of the patch size. My first question, though is, why is all the parameter documentation being removed from functions early in the path? They don't seem to fall into any of the categories where we omit documentation for expected parameters or return value docs (form handlers, menu callbacks, overridden methods...)
Comment #7
sven.lauer CreditAttribution: sven.lauer commentedSorry, I should have added a note about this:
These are all functions in image.gd.inc, which implement image toolkit operations for GD. I removed them because they duplicate the param/return value docs of the corresponding image_OP() function (which are in core/includes/image.inc). Technically, these are callbacks / hooks, I guess (well, REALLY these are implementations of an interface).
I decided to delete these after doing some research trying to figure out how they work exactly, as I was thinking of improving the param docs a little---and then realized that this should really be done in core/includes/image.inc . All of these have @see directives to the corresponding image_OP()-function, but perhaps we could make this a little more clear ... maybe by adding a line "See image_load() for the documentation of the parameters and return value." or something? We could also Prefix the summary with a "Image toolkit callback: "-prefix, though I am not sure this is terribly helpful. Finally, an @see system_image_toolkits() and/or @see hook_image_toolkits() might be helpful.
What do you think?
Comment #8
jhodgdonIn other cases, such as hook implementations, where we are omitting all doc because the params and return values are documented elsewhere, the function where it's documented is in the first line, such as:
- Implements hook_whatever().
- Overrides ClassName::foo().
So I think if we were going to do that here, we should do something similar... like making these:
Image toolkit callback: implements image_resize() for the GD toolkit.
or something like that? And @see hook_image_toolkits() does seem helpful...
But take a look at this:
http://api.drupal.org/api/drupal/modules--system--system.api.php/functio...
It's specifically referring to the image_gd_* functions for documentation of how to create these callbacks. So it looks like we shouldn't remove their documentation at all?
Comment #9
sven.lauer CreditAttribution: sven.lauer commentedHm, I am still not a fan of the duplication. But I guess these functions really serve as an ersatz callback documentation.
Attached patch restores the param/return value docs in image.gd.inc. I decided to prefix the summaries with "Image toolkit callback:", but left the rest as it was (Instead of changing it to a "Implements image_resize() for the GD toolkit" format), as these are not really implementations of the image_* functions, but are called by them (though most share there signatures with the calling function). I retained the @see to the corresponding image_* functions and added one to hook_image_toolkit().
Comment #10
jhodgdonThis seems like the right course of action for the moment. We should probably make an image.api.php file (or something with a similar name) to document the callbacks as "hooks" (or better yet, figure out a standard way to do callback function documentation), but at the moment this will do. I'll try to make time to review the whole patch later unless someone decides to beat me to it (please). :)
Comment #11
sven.lauer CreditAttribution: sven.lauer commentedI could break up the patch by file, if that makes it easier?
Comment #12
jhodgdonNope, one patch per issue. I am just very busy today, sorry!
Comment #13
sven.lauer CreditAttribution: sven.lauer commentedIt's a humungous patch, so I totally understand ...
Comment #14
jhodgdonWe had a discussion on #1315992: No standard for documenting menu callbacks and we have (unfortunately) changed the standard for hook_menu() callbacks:
http://drupal.org/node/1354#menu-callback
So this patch will need an update.
Comment #15
sven.lauer CreditAttribution: sven.lauer commentedThe attached patch removes the Path(s):-lines.
I have not added @returns in most cases. Not sure if the current standard REQUIRES those, and in most cases, this would lead to:
So this seems rather redundant. Let me know if I should introduce the returns nonetheless (I think cases like this could arguably be seen as "short forms").
Comment #16
sven.lauer CreditAttribution: sven.lauer commentedComment #18
jhodgdonYes, the @returns are needed, to distinguish between some page functions that might be returning HTML (which is legal, if not advisable), vs. renderable arrays. Check the discussion on the standards issue for more discussion.
Comment #19
sven.lauer CreditAttribution: sven.lauer commentedHere is a patch adding in the @returns.
Comment #20
sven.lauer CreditAttribution: sven.lauer commentedComment #21
xjmLooking at this patch, I guess the
@return
do actually add some useful information. It does actually differ from callback to callback.I think JSON should be all in caps here.
Comment #22
jhodgdonBesides #21, I see the following that need addressing in this patch:
a) Boolean should be capitalized:
b)
The "." got removed here.
c)
Should be Right-to-left-specific
d)
Too many blank lines here.
e)
Grammar cleanup needed here. Should be:
Modules that depend ... *on* one *of* these... *are* required...
f)
spelling: incompatible -- also I think maybe it should be in double quotes "" instead of single quotes ''?
g) Also... I found the new documentation for this function _system_is_compatible to be kind of confusing in general, and I don't think it matches what the function does. But actually this function does not seem to be ever called anywhere in Drupal 8 (except by itself) and I think it should be removed. So maybe we should just leave the doc block alone and remove the function (perhaps in another issue)?
h)
Needs , before and.
i)
submit -> submission
j)
Since there are several form submission handlers for different buttons here, I think the description of which button should go in the first lines of their functions?
k)
Too many blank lines here.
l)
- TRUE needs to be all caps.
- I think the @return should also mention that it could just return TRUE/FALSE instead of HTML markup.
- Boolean needs to be capitalized.
m)
Return -> Returns
n)
Needs . at end of line. Same here:
and here:
o)
Needs to be shortened to one line.
I ran out of steam and stopped around this spot in the patch (beginning of system.api.php)... sorry!
Comment #23
xjmAlright, I reviewed
system.api.php
(but not the files after). Few things I noticed:We should probably reword this to get it under 80 chars, correct?
While we're changing this line, can we please hyphenate "human-readable"?
This change seems out of scope for this issue, no? (I think there might be another issue about these somewhere.)
Should this use @see?
FALSE and TRUE should be capitalized here, I think.
Should we use an @link here?
Let's add periods for a.k.a. ...Actually, we could probably just remove "aka" entirely.
We should remove the word "Please" here.
I mostly just scanned all the rewrapped lines of text, so it's possible I could have missed any typos in those.
Comment #24
xjmAnd, the rest of the files. (Again, I just scanned the longer blocks of rewrapping, so we might want to proofread those again later.)
The word "mails" is a little weird.
Should the comma here be removed?
Typo: "the them."
Typo: "hanlder."
I read this a few times... so it's a configuration form for the action named 'system_goto'? Should we put that in single quotes for clarity, or is there another name to use?
I think "times and dates" should be pluralized, right? (Because they differ from timezone to timezone.)
This confused me at first. Maybe we could change it to:
...when the destination file already exists. Allowed values:
Would that be more clear?
Typo: "Retrievess."
Should be "stores it directly to the queue.
Typo: "Assert sthere."
There should be a comma after "disabled" here.
Maybe "Attempts to enable the Translation module"?
Hmm, I can see that you're rewording this to get it under 80 characters, but "modules incompatible with core" is WTF-y. Maybe "Tests module dependency chain with an incompatible core version." or something? Not sure exactly. (The summaries for all three of these tests are a little awkward, but this one in particular seems incorrect.)
I think it should be "Tests whether..."
Probably should be "Resets the page title."
Maybe "Tests HTML handling in..."?
Maybe "XSS-proof" should be hyphenated? (I'd also quibble with the idea of something being XSS-"proof"... maybe it would be better to say "Tests XSS protection for the site title" or something.)
I don't think "powered-by" should be hyphenated, and I think the names should probably be capitalized and/or quoted. Maybe:
Tests displaying and hiding the "Powered by" and "Help" blocks.
How about:
Tests the main content rendering fallback provided by the System module.
Should probably be "Tests the availability of the main content [something-or-other]."
Needs a verb.
Phew! This patch is a monster. Thanks @sven.lauer!
Comment #25
xjmOh, one other thing. I didn't see the parameter documentation from #2 in there--should we add that here, or open a separate issue? I don't want to force rerolls on this patch if we put it in a separate issue, so if we go that route, maybe we should postpone it.
Comment #26
tim.plunkettI noticed some oddities with hook_element_info, and I wanted to add them in here, but I ended up rerolling and trying to incorporate #21-24. Hope you don't mind, sven.lauer!
#23 3) I think this change is fine for this issue. I couldn't find another open one referring to it either.
#23 4) Not sure.
#23 6) Not sure.
#24 18) powered-by is the block delta, and is used in a lot of places. Not sure about changing this here.
Part of the changes to this patch were moved to includes/theme.inc by #761608: Missing theme settings values because list_themes() has inconsistent theme object data, I kept them in here for now.
Comment #27
xjmBOTIFY!
Comment #29
xjmOops, I meant to say this above, but I think "timezones" is one word.
Other than that, all the changes in the interdiff look correct to me.
Comment #30
xjmOops, one more thing. This should probably be:
- #title_display: (optional) String indicating...
Comment #31
xjmThe full patch in #26 probably should be reviewed one more time. Edit: or make that in #32!
Comment #32
tim.plunkettRerolled, also fixed some more s/boolean/Boolean.
Left in the ones that should become bool when we do the data types stuff.
Comment #33
sven.lauer CreditAttribution: sven.lauer commentedThanks, tim.plunkett for picking up my slack!
(Yes, it is one beast of a patch, but I still feel kind of bad for overlooking so many things ...)
Comment #34
jhodgdon#32: drupal-1326664-32.patch queued for re-testing.
Comment #36
jhodgdon#32: drupal-1326664-32.patch queued for re-testing.
Comment #38
jhodgdonLooks like this needs a reroll.
Comment #39
tim.plunkettConflicted with http://drupalcode.org/project/drupal.git/commit/c1c2ceab and http://drupalcode.org/project/drupal.git/commit/982087f2.
Comment #40
xjmWell, I got through
hook_mail_alter()
on the re-review and didn't find anything wrong.Comment #41
jhodgdonI started after hook_mail_alter() and found the following:
a) (system.api.php: hook_xmlrpc)
There are two spaces between , and -12
b) (system.api.php: hook_watchdog)
This , should be a ; (comma splice).
c) (system.api.php: hook_watchdog)
- All these list items should end in .
- It would be nice to be consistent and make them all say condition/message instead of conditions/messages.
d) (system.api.php: hook_mail)
This is two sentences instead of one in the first line description. Either move the second to a new paragraph or combine them into one sentence.
e) (same)
id -> ID in the second line.
f) hook_stream_wrappers()
a ... implementations -- is it registering one or many? I think it's many, and therefore "a" should be removed.
g) hook_requirements()
Typo: ibrary -> library
h) hook_schema()
needs comma before which.
i)
This does not need to be a @link (no link text). Please remove the @link and just put the URL on the previous line.
j) hook_uninstall()
List items need to end in .
k)
morei nformation --> typo
l) hook_action_info()
List items need to end in . [in the last one, the . should be outside the )]
m)
Two spaces after . instead of one.
n) system.js:
Needs paragraph wrapping.
I stopped at the top of system.module in the patch.
Comment #42
jhodgdonI also noticed these things in the top part of the patch:
a) system.admin.inc
selction (typo)
And continuing with the review, in system.module:
b)
Needs "the" as second word.
c)
The default value could be indicated more compactly by putting (default) on the default item in the list.
d) system.queue.inc
Needs one-line description.
e) system.updater.inc
This makes no sense to me... "one a new version"??? Maybe it should be "when"?
f) theme.api.php
Parenthesis opened but never closed.
Phew, I think that's it!
Comment #43
tim.plunkettWhen #1471376: Convert updater.inc to PSR-0 was committed, most of the changes from this patch were incorporated. This only catches a few extraneous changes from there, which is why the patch is smaller.
Incorporated the changes from #41.
Comment #44
tim.plunkettCross post! Rerolled again.
Comment #45
xjmWow, so apparently I went into a trance there yesterday when I tried to review this. ;)
Comment #46
tim.plunkettRerolling after #1373142: Use the Testing profile. Speed up testbot by 50%.
Comment #47
jhodgdonWait... This is supposed to be system.module. How come the first several hunks in the patch are not part of modules/system?
Comment #48
tim.plunkettThose hunks were in system.module when this patch started. :)
In my rerolls, git moved them to where ever the code went.
It would be trivial to strip those out, but harder to track down if I stopped including them in rerolls.
Comment #49
tim.plunkettThe 4 no-longer-in-system-module hunks were moved out by these issues:
#761608: Missing theme settings values because list_themes() has inconsistent theme object data
#1468244: Convert DrupalQueue system to PSR-0
#1471368: Convert uuid.inc to PSR-0
#1468244: Convert DrupalQueue system to PSR-0
They can each be moved there as follow-ups, or kept in here.
Comment #50
jhodgdonAh, OK, seems sensible to get them in here. If no one beats me to it, I'll give this a review tomorrow, and then hopefully commit it. But if we're over thresholds again, I'll probably have to hold off on committing it, as it is intersecting with a lot of patches (obviously).
Comment #51
tim.plunkettRerolled around #1471364: Move mail system classes from system.mail.inc to PSR-0 classes in Drupal\Core.
Comment #52
jhodgdonTop part of the patch nitpick:
Technically, "mail" is not a countable noun, so can't be pluralized. Should say "e-mail" not "mails".
I wouldn't have mentioned it, but then I went on and did a careful review of the system.admin.inc part of this patch. It needs a bit of work:
b)
The last sentence here makes zero sense to me as it is written. There are several things that need rewording.
d)
Similar to (a), I don't think we need that line telling us that system_ip_blocking_form() is displayed. That kind of technical information is immediately obvious from the code.
e)
The $options parameter should not have been removed from this doc block.
f)
I would not really say here the $action is optional. If it's missing, this function just redirects back to another page instead of constructing the form. So let's leave out the (optional).
I ran out of steam here. The next section to review starts at system.api.php.
Comment #53
jhodgdonContinuing on... In system.api.php:
g)
This should not be e.g.. E.g. means "for example". If you want to change it to either "i.e." or "that is", the punctuation is wrong, should be:
....properly; that is, all required...
h)
id is a psychological term. ID means identifier. Two misuses here.
i)
Wrapping needs attention here.
j)
Can we clean this up a bit?
- "and then you should write" -- eek! How about, "The first element is...; remaining elements are the types of ..."
- (See... => see should not be capitalized... actually how about just (see http://whatever) without "the types at"?
k)
Respond the --> Respond to the
l)
- or needs a comma before it [first section]
- for example needs to have commas before and after it [second section]
- not belong to -> not belong in [third section
What remains to be reviewed again starts with system.archiver.inc
Comment #54
jhodgdonMoving on... in system.js:
m)
Should start with Checks.
n)
I don't think we need so many blank lines here?
Phew! I got through the file finally... Review is done.. Anyone for a fix-up job? :)
Comment #55
sven.lauer CreditAttribution: sven.lauer commentedPerhaps it's not the best time to re-roll this, as we are over multiple issue thresholds, but I had the time, so I quickly did this. Attached patch is a re-roll of #51, addressing the comments in #52 to #54.
The patch no longer contains the changes for the Archiver classes, as these were fixed in the process as moving these classes to core/lib as part of the PSR move.
Comments:
Duh! That is probably what was intended, yes.
I removed the
@see
s to the theme functions where theme() is called in the function body (I had left/put those in originally because I did not know that auto-linking theme functions was on the horizon. I have not touched the back-references (from theme function to invoking function) for now.Arg. I wrote this after spending an extended time trying to figure out what the function does with its parameters, and why. I must have been quite exhausted. Looking at the doc of this function globally, I realized that the @return actually is quite clear and concise about what happens to the $incompatible parameter, except for what happens to it on recursive calls. So I added a comment trying to explain this, and removed the confusing sentence from the param doc.
(Really, the name of this function should be changed---the function does not do anything related to incompatibility, per se: It determines whether a given module depends, directly or indirectly on one of a set of given other modules.)
I don't think that "i.e." / "that is" is what was intended here---rather, what the function returns in this array element is a boolean indicating whether the toolkit is operational, and an example of what an implementation might check is whether all required libraries exist, but there presumably could be others. I split this into two sentences and reworded things to make this more clear.
Comment #56
sven.lauer CreditAttribution: sven.lauer commentedComment #57
sven.lauer CreditAttribution: sven.lauer commentedP. S. The interdiff is missing the fix for i), which is in the patch, as the interdiff was made against an intermediate re-roll of #51 just to make it apply, and I had fixed the wrapping issue while making the patch apply.
Comment #58
xjmI reviewed the interdiff and all the changes there look good. The new text for
_system_is_incompatible()
is much clearer. I did notice this one thing:Looks like we missed an "id" here.
I haven't read the full patch yet.
Comment #59
xjmAlright, I reviewed again from
system.api.php
through the end. Note that some of my notes about rewrapping below might be mistaken; I was eyeballing it, so check before rewrapping something. :)Another id.
I think the period should be replaced with a comma and the paragraph should be rewrapped.
There should be a conjunction or semicolon after "messaging".
I think this could be rewrapped.
I think we can remove the opening "Set to..." and te word "please" here.
I think FALSE and TRUE should be capitalized here.
We could use
@link
here.We could link the words Schema API Handbook here using
@link
.I think we prefer the final serial commas here (after "adding", "keys", "numbers", etc.).
Or, we could use the @link on the text "batch operations page"?
I think all these paragraphs need rewrapping?
Needs rewrapping I think?
Really minor, but I think this should be "2- and 5-character locale codes"? Also, the comma before "defining" seems wrong to me.
We could probably spin this off into a followup issue since we're not already changing these lines, but the capitalization for "Updater" is really inconsistent. If it weren't for "Updater classes" I'd say it should all just be lowercase, but I'm not sure.
"Read-only" should be hyphenated; and the comma should be replaced with either a semicolon or a period + new sentence.
I think per the new capitalization policy "Update Manager" should be Proper Noun Case? Reference: http://drupal.org/node/604342#capitalization
"etc." needs a period.
I think the wrapping is not quite right here.
I think "Shows and hides" would be better?
The comma here seems incorrect to me.
This is under 80 characters:
What do you think? Otherwise, I'd at least recommend replacing the slash with "and" and updating the wrapping for the second paragraph.
Is the operation passing in the object? Otherwise there should be a comma after "operation."
I think "timezone" needs to be one word here as well.
The word "their" is a little weird here--perhaps:
Scans and collects theme .info data and engine information.
This is kinda awkward. "Tests functionality for enabling and disabling modules," perhaps?
I think "Locale" needs to be capitalized here as well.
"Tests" here is being used as a noun, I think, unless we are testing for the presence or absence of shutdown functions, which I don't think is the case.
The docs in this group are quite redundant and there are a few style errors as well. I'd like to open a followup issue to clean this up.
Comment #60
xjmI'll do the top of the patch after supper; after that, an updated patch with interdiff would be great. At that point I'll just review the interdiff again, and if everything in it checks out I'll be comfortable RTBCing this bad boy.
Comment #61
xjmAlright, reviewed the rest and found just a few more things:
Hrm, why is this being rewrapped? Looks to me like the original line is already under 80 chars.
Does GD need to be in parens here?
It sounds like this is actually a form constructor? Or am I mistaken?
Minor thing, but I think this should be "an empty string" rather than "the empty string"?
Typo here (double opening paren).
These are kind of confusing; for the first, maybe:
Form constructor for the 'Add new date format type' form.
or
Form constructor for a form to add new date format types.
Similarly for the second and third constructors.
Comment #62
sven.lauer CreditAttribution: sven.lauer commentedRerolling addressing the issues in #59 and #61, except:
6. in #59: "false" and "true" are not PHP constants here, but the English words, so I think we should not capitalize them.
14. in #59: Let's postpone this for another issue, esp. since I am also not sure what the right thing to do is (with "Updater class" in particular.
#61, unnumbered: No, the period takes us over 80 chars.
Comment #63
jhodgdonI agree with xjm about #59/6 (caps for FALSE/TRUE).
RE #59/14 Capitalization... I don't think we need a separate issue. There is a class called Updater, and hook_updater_info() in system.api.php allows modules to tell Drupal about their own updater classes.... So, to be consistent with English rules and how we're doing other things in core, I think the capitalization should be:
- If referring to the specific Drupal Core class called "Updater", capitalize it.
- Otherwise, don't capitalize. This is consistent with the other hook_*_info() hooks in core, which do not capitalize their subjects ("block", "filter", "hook", etc.). So we also shouldn't have caps for "the updater classes", "decide if each updater wants to...", "override an existing updater", etc.
Comment #64
NROTC_Webmaster CreditAttribution: NROTC_Webmaster commentedComment #66
xjmUpdating for #1299424: Allow one module per directory and move system tests to core/modules/system.
Comment #67
jhodgdonI'm going through these issues and un-assigning any without activity for several weeks. If you still want to work on this issue, please feel free to assign it back to yourself. Thanks!
Comment #68
Albert Volkman CreditAttribution: Albert Volkman commentedOuch, this one was fun. Patch #62 didn't apply cleanly, so I reverted the code to revision e6e4bc1 and applied patch #55. After merging and handling conflicts, I then went back through @xjm's updates and re-applied. This will unfortunately probably need a complete re-review as I can't create an interdiff.
Comment #69
Lars Toomre CreditAttribution: Lars Toomre commentedAs part of #1800046: [META] Add missing type hinting to core docblocks, fix Drupal.Commenting.FunctionComment.Missing*, I created a sub-issue #1800330: Add missing type hinting to System module docblocks to address the addition of missing type hinting to the System module.
Comment #69.0
Lars Toomre CreditAttribution: Lars Toomre commentedAdded follow up issue for missing type hinting.
Comment #70
Lars Toomre CreditAttribution: Lars Toomre commented#68: doc-cleanup-system-module-1326664-68.patch queued for re-testing.
Comment #72
Lars Toomre CreditAttribution: Lars Toomre commentedI am at a bit of a loss about why we are trying to commit one patch of more 170KB with everything being perfect. Such big patches are difficult to review and take a long time to get fully reviewed and committed.
Why not commit 70-90% of the current patch and then further refine? If this approach is acceptable to @jhodgdon, I will re-roll a portion of #68. Hence, while we further refine the documentation, what the D8 developer sees is closer to D8 ideal standards.
Comment #73
jhodgdonYeah, sorry, the approach we were taking in the past on these patches wasn't working all that well... So yes, if you can make a patch that doesn't introduce new errors, I will commit it. I'm not really willing to commit patches that introduce new problems (such as substituting one bad piece of documentation for another bad piece of documentation), but for instance if you make a patch that just fixes the "make sure there are spaces between @param and @return", I would commit that, and then we could go back and do the next bit of cleanup.
Comment #74
Lars Toomre CreditAttribution: Lars Toomre commentedIn keeping with the thought that incremental improvements help move the proverbial ball forward, the attached patch is based on the previous work up through #68. The thought is that once this is committed another incremental patch will be rolled.
This patch addresses the changes that were included in the first nine files of #68. For those docblocks that were changed, this patch adds type hinting for all @param and @return directives that were missing.
I am unsure whether this was too big or too small of an incremental change. Feedback would be appreciated @jhodgdon.
Comment #75
jhodgdonType hinting -- PLEASE NO! That makes the patch really hard to review, and is *specifically* not included in this effort.
Comment #76
Lars Toomre CreditAttribution: Lars Toomre commentedBecause I included type hinting, I purposely kept the incremental patch small. I believe @jhodgdon you will find this incremental patch easier to commit. I think all of the type hinting is in the GD toolkit file.
Comment #77
jhodgdonPlease remove the type hinting to a separate issue. The cleanup stuff that *is* part of this particular clean-up initiative requires almost no thought to review, and the review can be done without even looking at the code. Whereas the type hinting requires a careful read of the code to make sure it is correct. I can't give this patch a quick look-over to see if it's all fine and commit it with that type hinting in there, and I do not have Drupal volunteer time that I want to spend any time soon reading the code carefully just to commit a clean-up patch (there are several other clean-up patches waiting in the queue, and API module improvements to do, etc.). Sorry, that's just how it is.... Type hinting is a separate effort, and it is that way for a reason.
Comment #78
Lars Toomre CreditAttribution: Lars Toomre commentedI will leave it to others to roll incremental patches based on #68. I am glad that I did not waste more time on #74 since it apparently never will be committed.
Comment #79
jhodgdonI'm sorry that this is frustrating for you. It's also frustrating for me -- I've been through this discussion about type hinting for this particular initiative so many times that I don't have much patience for explaining again why they aren't part of this particular initiative and why I'd appreciate it if they weren't added to patches on this initiative. Would you consider re-rolling the patch without the type hints so that we can move forward?
Comment #80
Lars Toomre CreditAttribution: Lars Toomre commented@jhodgdon I appreciate you are frustrated. I am too, probably to some exponent.
As you may have guessed, my main concern is getting core code compliant with type hinting for all @param and @return directives.
I use the API website often when coding for client projects. Many times I have seen the equivalent of '@param $id' and I have had to investigate what type of ID was requested. Was it an integer, a string, or a uuid? A valid type hint in such cases reduces the need to inspect whatever function is called.
Comment #81
jhodgdonPlease... Do I have to say this again really? Yes, type hinting is great. No, it doesn't belong on this issue. Please move the type hinting part of this patch to the initiative you have already started for that, and get the patch reviewed there (there are plenty of people who feel strongly about it as you do), and it will be considered for committing. Don't put it here. And please don't keep discussing this on this issue, which is part of an initiative which does not include type hinting and which I am the only reviewer/commiter for. Please. Please. Please.
Comment #82
Lars Toomre CreditAttribution: Lars Toomre commentedOK, here is a patch that is easy to review based on #74. It does not include any type hinting.
Comment #83
Lars Toomre CreditAttribution: Lars Toomre commentedWhoops.. forgot to change staus/
Comment #84
jhodgdonLooks pretty good! This needs a quick update for two small fixes, and then I think it can go in:
a) image.gd.inc
- That first paragraph here has a grammatical error "element... are integrated". Should be "elements".
- The return needs "the" added: ... to be added to *the* form.
b) In image_gd_rotate() docs:
A hexadecimal... not An hexadecimal...
Comment #85
Lars Toomre CreditAttribution: Lars Toomre commentedHere is a re-rolled untested patch with fixes for the comments in #84. I also caught one more @see that was missing. An interdiff is also attached.
Comment #86
jhodgdonThanks! I committed all of this patch except the system-rtl stylesheet change (it should have replaced that line, not added to the documentation header):
I missed that in the last review, sorry!
So... There is more to be done on this issue... There were files in the patch from #68 that didn't make it into the patches starting in #74 that led to this patch, so let's go back and get the rest (or another chunk) in the next patch. Thanks!
Comment #87
Lars Toomre CreditAttribution: Lars Toomre commentedThanks very much for your review @jhodgdon. I really appreciate all of your reviews and commits!! It is making the core documentation so much better. Thanks again for all of your efforts.
Comment #88
Lars Toomre CreditAttribution: Lars Toomre commentedThis untested patch is the next in a series of patches trying to bring the System module up to D8 documentation standards as laid out in http://drupal.org/node/1354.
When I started to work on this patch, I was hoping to complete a full review of the top level files. However, given the high number of changes in both the system.module and system.admin.inc files, it appears reasonable to cut off this patch at least where it can be reviewed more easily.
This patch does include a few other small changes in other files including the item @jhodgdon outlined in #86. I did not yet get a chance to review the open items left over from #68. I hope to do so once this next chunk of changes are committed.
Let's see what the bot thinks of this locally untested patch.
Comment #89
Lars Toomre CreditAttribution: Lars Toomre commentedI added what is a fairly large patch in #1800330-2: Add missing type hinting to System module docblocks that adds missing type hinting to the three *.api.php files in the system module.
While creating that patch, I noticed that there were missing @param directives and much list formatting clean-up in those three files. That probably should be the next chunk to be completed after #88 is committed.
Comment #90
jhodgdonThanks for the patch! I reviewed about half of it, and found quite a few things that need attention... presumably the second half has many of the same problems, since most of them were repeated several times in the patch. Here's what I found:
a) The first-line changes in language.api.php are wrong:
http://drupal.org/node/1354#hooks
b) system.admin.inc
Should be : not ;
c) Some first-line descriptions and other added documentation could use a/an/the added, such as:
- Menu callback: Creates form to display theme configuration. ==> *a* form to display *the* theme configuration
- This form constructor creates a theme configuration form that can be used both for entire site and for individual themes. ==> for *the* entire site
- Menu callback: Provides module enable/disable interface. ==> Provides *a* module...
There are others... reading through the patch would be helpful.
d) On the other hand, this "the" should be removed:
e) system_modules() should be documented as a form constructor (and leave out @param for form, form_state). Same for system_performance_settings(), and possibly other form constructors too. Some submission handlers are also not brought up to standards.
f)
See http://drupal.org/node/1354#callbacks
g) First line for system_modules_uninstall() needs a verb... or needs to be documented as a form constructor (after Page callback:). One or the other. Oh, and it should say "Page callback" not "Menu callback".
There are several other functions like this too. The standard is:
Page callback: Form constructor for...
Nothing should ever say "Menu callback:". See
http://drupal.org/node/1354#menu-callback
h) In several cases, information was lost when updating the form submission handler docs to standards. For instance:
Probably both of these should say "Form submission handler for the ... button for system_performance_settings()" so that the information is not lost. There are other examples like this in the patch as well.
Comment #91
Lars Toomre CreditAttribution: Lars Toomre commentedReading about callbacks, I am unclear about what the problem is with item f) as it was changed in #88. @jhodgdon, Could you please elaborate with a more complete example of what you were expecting?
Here is an updated patch that addresses everything else from #90. I am unable to create an interdiff from #88 because independent changes in the interim to system.module. I am presuming this will need a yet further re-roll after a review of the changes to system.admin.inc, a detailed review of the changes in system.module file itself, and fixing #90 f) once I understand what I was doing wrong.
Comment #92
Albert Volkman CreditAttribution: Albert Volkman commented@Lars Is system_sort_themes() a callback for uasort()? It looks like you just copied the example in the documentation.
Comment #93
Lars Toomre CreditAttribution: Lars Toomre commentedThanks for your help @Albert Volkman.
system_sort_themes() is a callback used in a call to uasort() in the function system_themes_page(). How is this supposed to be documented? I am unsure of what I have done wrong.
Comment #94
jhodgdonThe line about "Callback for..." is not supposed to be the first line of the function -- the first line should still say something like "Sorts the..." or whatever.
Comment #95
Lars Toomre CreditAttribution: Lars Toomre commentedAh, now I better understand. Perhaps we can clarify the example in http://drupal.org/node/1354? It was not at all clear to me.
Comment #96
Lars Toomre CreditAttribution: Lars Toomre commentedHere is an incremental patch that also addresses #90 f). Thanks for the clarification @jhodgdon.
Comment #97
jhodgdonUm. http://drupal.org/node/1354#callbacks starts with:
"For callbacks, add a blank line after the summary, followed by a line that identifies the callback's purpose. Use the following format:"
Can you suggest clearer wording? I think this says to leave the summary as normal and have an additional line with that format?
Comment #98
Lars Toomre CreditAttribution: Lars Toomre commented@jhodgdon Reading the text was confusing given the example that followed. Perhaps we could expand the example portion to something like:
'For example, a callback function used by uasort() might be documented as follows:'
My wording may not be correct, but hopefully the gist of my thought is clear.
Comment #99
jhodgdongood idea, how's this? http://drupal.org/node/1354#callbacks
Comment #100
Lars Toomre CreditAttribution: Lars Toomre commented+1! Looks good and is clear about what is expected. Of course, what I rolled in #96 is similar, but more verbose.
Those changes can fixed though after the next review of the patch. I am particularly interested in any comments on the changes in system.module because many are different from what was in system.admin.inc module (which was the primary file reviewed in #90).
I also realize that this module may well be the trying to clean up since it is has evolved through many generations of Drupal and evolving documentation standards. The "small" 63KB patch in #96 only addresses five files from this module (although probably the ones with the most changes needed).
Comment #102
Lars Toomre CreditAttribution: Lars Toomre commentedI don't think that test failure has anything to do with this patch. Let's try that again.
Comment #103
Lars Toomre CreditAttribution: Lars Toomre commented#96: 1326664-96-system-docs.patch queued for re-testing.
Comment #104
jhodgdonLooks pretty good! A few things to fix up:
a) This is a bit more verbose than our standard wording for callbacks (see links above):
Also, "os" is misspelled in that line.
b)
Normally in hook definitions, we wouldn't need the "Allow modules to...". So this could just say "Act after language...". (That would also be more consistent with the other hooks in this file).
c)
Omit @return for form constructors. (Applies to several other functions in this patch too.)
d)
These two functions do two different things and your docs have lost that information. One should say "for the run cron button on..." or something.
Similarly:
It would be good if the information was in the first line about which submit handler does what (also "clarng" is misspelled).
e)
I'm not too fond of how that @param doc is worded.
f) Looks like this patch isn't finished:
g) in system.module:
Should be : not ; here
h)
- First line: Should say "Access callback: " and then start with a verb.
- Doesn't need @return for an access callback.
i)
Typo in first line.
j)
See above comments about callback function standards.
k)
This should not be part of @ingroup forms (that is for form-generating functions, not the form API core fucntions, right?).
- Typo in the first line also.
l)
I think that was intended as @see?
m)
- First line: ; ==> :
- It seems really silly to me to write out "negative 1" in code docs. Just write "-1".
- The type for @param $is_daylight can't be right since the default is NULL... and the documentation doesn't say anything about what NULL means/does.
n)
Revert this change. See http://drupal.org/node/1354#themeable -- same for the other theme_xyz() functions in this patch.
Comment #104.0
jhodgdonAdded related issue link to #1533400: Make system module (except tests subdirectory) pass Coder Review.
Comment #105
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!