Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
11 Jan 2010 at 17:09 UTC
Updated:
3 Jan 2014 at 01:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jhodgdonHere's a patch. Also brings doc into compliance with doc header standards.
Comment #2
dries commentedThere are many other possible culprits (ignore the many false positives):
Comment #3
dries commentedI committed the patch from #1 to CVS HEAD. Thanks a lot.
I guess I'll leave this as 'needs work' because of #2?
Comment #4
jhodgdonSounds like a plan.
If someone wants to take a look at patching this, it would be a good project for a novice patchmaker. :)
I'm not sure what we're doing about displaying classes on api.drupal.org or documenting them. Anything in CamelCase in the above list is likely a class, so don't put parentheses on those. However, things like self::installArgs are probably member functions from classes and probably need parens.
Items in ALL_CAPS are constants and should also be left as-is.
File names like file.info are OK as is.
Obviously, links are OK too.
Comment #5
aspilicious commentedI made a patch with following changes:
@see drupal_page_header ==> @see drupal_page_header()
@see db_change_field ==> @see db_change_field()
@see theme_table ==> @see theme_table()
@see drupal_render_page ==> @see drupal_render_page()
@see template_process_page ==> @see template_process_page()
@see self::getInstallArgs ==> @see self::getInstallArgs() (2 times)
@see drupal_parse_info_file ==> @see drupal_parse_info_file()
@see system_authorized_init ==> @see system_authorized_init()
Comment #6
aspilicious commentedstart the testbot
Comment #7
jhodgdonGood try... There's one little problem: lines like this are still not OK:
This is what it results in: http://api.drupal.org/api/function/system_modules/7
@see needs to be on its own line, not embedded in other text. Those two places where @see is in the middle of a paragraph, the @ should be removed removed so it's just the word "see", and the () needs to be added to the function so it will make a link in-line with the paragraph.
Comment #8
aspilicious commentedThis one better?
Comment #9
aspilicious commentedstart testbot
Comment #10
jhodgdonYes... except that all @see lines really should be at the end of each doc header, because they make a section when rendered on api.drupal.org.
So for instance:
This should probably also be just a plain See rather than an @see, because we don't really want a See Also header in the middle of the Parameters section.
Also, there are numerous other problems with the doc around these @see links, such as that it should be wrapped at 80 lines and there are grammar problems... Sigh. If I were making this patch, I would fix the doc up in each doc header that was being fixed, but I'm willing to let it go if you will just make sure that @see is only used at the very end of each doc header.
So if the @see is particular to a section, change it to just See. If it's a reference to a similar/related function, put it at the end. Does that make sense?
Comment #11
aspilicious commentedI made a massive patch that NEEDS review cause I wasn't sure about everything I did...
Took me 90 minutes....
Check for trailing white spaces or the use of capital in see/See
Comment #12
jhodgdonWow, thanks for all that work. Needs a few small fixes, but I think it's almost there:
a) There are several places where you changed @see to "see" and it needed to be "See" because it was the beginning of a new sentence. For instance this password.inc segment:
Also, in these cases, The See (whatever) sentences should flow from the previous paragraph, and not be on their own lines. Wrap at as close to 80 characters as possible.
b) This looks a bit funny to me -- not sure why we're linking to php.net in one place and realpath() in another? Also again see needs to be See, and there are some wrapping problems:
c) You weren't consistent about whether you put a blank line between the @ingroup and the @see. I think there should be, but the standards are not clear (http://drupal.org/node/1354). At least be consistent within your patch. :)
Comment #13
aspilicious commentedThe code is just not consistent in the first place ;)
Cause in some places every @statement is put against eachother, in others they are seperated!
Comment #14
aspilicious commentedI made it more consistent and changed some rules I found in between.
But I think it's best to open 2 new topics:
1) checking 80 characters a line for comments
2) a white line between the @xxx blocks
==> white line between @param and @return for example
I don't rly know what you mean with something wrong with wrapping.
I'm gonna go on a skiing holiday tomorow, so if this isn't good enough, reply fast. Else you gotta do it yourself ;)
Comment #15
aspilicious commented...
Comment #16
jhodgdonWell, that is true. There are a lot of places where Drupal does not follow its standards. What we try to do is whenever a new doc patch is put in, improve the situation rather than making it worse or leaving it as out of compliance.
You might want to read the standards doc, if you haven't already: http://drupal.org/node/1354
Comment #17
aspilicious commentedI read it but you need to change A LOT so it's to difficult to do it at once (due to constantly changing head). I'm prety sure I fixed (almost?) every see in core. So why not commit this and when I'm back I'll look on those other issues
Comment #18
aspilicious commentedNOOOOOOOOOOOOOOOOO
====>
Second, I found that although the documentation suggests using @see over several lines is ok
@see drupal_render()
@see hook_theme()
It actually results in strange results on the finished page. Multiple @see should be written @see drupal_render(), hook_theme(). I don't think this is just me, you can see this error on, for example, http://api.drupal.org/api/group/themeable/6.
Comment #19
aspilicious commentedStil need review, what do you think about the problem stated in 18
Comment #20
jhodgdonRegarding #18, the consecutive @see rendering issue is a known issue in the API module and is being worked on. It's all over Drupal, and also is the current coding standard to do it that way.
Regarding #17, we don't generally commit patches that remove one error and introduce new errors. I'm not comfortable committing the patch in #14 as it is.
We can go back to the patch in #8, though: just fix those few functions up to conform to standards, rather than the huge patch you are trying in #17 that tries to fix all @see related problems in the entire code base. That is the kind of incremental change that is OK to commit, because it fixes things and doesn't introduce new problems.
Comment #21
jhodgdonForgot status change. We can't commit the patch in #14.
Comment #22
jhodgdonThis patch goes back to the patch in #8 and fixes up some additional problems in those doc headers.
Comment #23
dries commentedCommitted the patch in #22. Let's figure out what other changes need to be incorporated from patches above. Thanks for all the hard work, folks.
Comment #24
trevjs commentedRe-ran Dries's grep, a lot of these are references to files or class functions:
trev@Ubuntu:/var/www/dev/drupal-7.x-head/drupal-cvs$ grep -r "@see" . | grep -v "()" | grep -v ".php" | grep -v "Interface" | grep -v "http://"
./misc/drupal.js: * @see Drupal.attachBehaviors
./includes/batch.inc: * @see form.inc
./includes/database/database.inc: * @see SelectQuery
./includes/database/database.inc: * @see InsertQuery
./includes/database/database.inc: * @see MergeQuery
./includes/database/database.inc: * @see UpdateQuery
./includes/database/database.inc: * @see DeleteQuery
./includes/database/database.inc: * @see TruncateQuery
./includes/database/database.inc: * @see DatabaseTransaction
./includes/database/database.inc: * @see DatabaseTransaction
./includes/database/database.inc: * @see DatabaseTransaction
./includes/database/database.inc: * @see DatabaseTransaction
./includes/database/database.inc: * @see DatabaseLog
./includes/database/database.inc: * @see DatabaseLog
./includes/database/database.inc: * @see SearchQuery
./includes/common.inc: * @see element_info('page')
./includes/common.inc: * @see forum.info
./includes/common.inc: * @see garland.info
./includes/common.inc: * @see DrupalEntityController
./includes/common.inc: * @see DrupalDefaultEntityController
./includes/form.inc: * functions using \@see. Conversely, validate and submit functions should
./includes/form.inc: * reference the form builder function using \@see. For examples, of this see
./includes/cache.inc: * @see DrupalDatabaseCache
./includes/menu.inc: * - options An array of options, @see l for more.
./includes/theme.inc: * @see MARK_NEW, MARK_UPDATED, MARK_READ
./includes/file.inc: * @see
./modules/node/node.test: * @see TaxonomyNodeFilterTestCase
./modules/system/system.module: * @see FileTransfer
./modules/simpletest/tests/mail.test: * @see DefaultMailSystem
./modules/simpletest/tests/database_test.test: * @see FakeRecord
./modules/overlay/overlay-parent.js: // @see overlay-parent.css .overlay-loaded #overlay-element
./modules/overlay/overlay-parent.js: // @see https://bugs.webkit.org/show_bug.cgi?id=19033
./modules/overlay/overlay-parent.js: * @see Drupal.overlayChild.behaviors.addClickHandler
Comment #25
jhodgdonOf those, the only ones I think need fixing:
./includes/common.inc: * @see element_info('page')
./includes/menu.inc: * - options An array of options, @see l for more.
./includes/file.inc: * @see
The rest are file names, class names, constants, or URLs I think.
That second one should be "- options: An array of options, see l() for more."
That last one should probably be removed, but you'll need to look at the file to see what's up there.
The first one I don't think will turn into a link with the 'page' in there, but you could look at api.drupal.org to see if I'm wrong about that.
Comment #26
jhodgdonYou might also take a look at the patch in #14, with the comments in #12 and after #14.
Hmmm... The link is not working for me, but the patch is here:
http://drupal.org/files/issues/681538_followup_14.diff
Comment #27
trevjs commentedTalked with jhodgdon about this in irc. I should be able to take care of what is left.
Comment #28
trevjs commentedHere is 2 of the 3
Comment #29
trevjs commentedComment #30
jhodgdonJust FYI - we usually try to make 1 patch per issue -- make one patch that combines all the files together. You can probably just use a text editor to cram them into one file, because it looks like you're not using CVS to make your patches?
Anyway, that aside...
The menu.inc patch -- You don't want to use @see in the middle of a line. Putting @see in a doc header produces a See Also section in the doc, so it needs to be on its own line. So that @see should be replaced with just the word "see".
Also, that menu.inc doc section is broken. I think it's trying to create a list, but it's not doing it the right way.
See http://drupal.org/node/1354#general (Lists section)
It would be lovely if you could fix that along with the @see fix.
Comment #31
trevjs commentedLets see if this takes care of those three.
What am I looking for in the patch from 14?
Comment #32
jhodgdonThe patch in #31 looks good to me.
Regarding the patch from #14/#26, there may be some additional broken @see spots in that patch too that haven't yet been fixed. I'm not sure though.
Comment #33
jhodgdonUnfortunately someone (sigh) also decided to file a separate issue on this exact same subject:
#748550: Fix incorrect usage of @see directive.
Comment #34
aspilicious commented#31 and the patch in #748550: Fix incorrect usage of @see directive. are not rly the same
Comment #35
jhodgdonThat is true, but I think the other item is expanding on your earlier patch from #14, isn't it? So I'm not sure why you filed another issue?
Comment #36
aspilicious commentedGet ready for a monster patch.
I included the fixes of #748550: Fix incorrect usage of @see directive. and marked that topic as duplicated of this one.
What to do with these matches:
I don't want to reroll this to much :(
Comment #37
jhodgdonComments on the patch:
a) menu.inc section - if you are going to get that up to standards, you could also put in a blank line before the @return. :)
b) There are a couple of spots like this, where @see -> See, and the result is a sentence, so needs a period at the end now:
c) Along that line, all // comments within code are supposed to end in . and be wrapped at 80 characters. A couple of the fixed ones now don't.
d) Wrapping:
See should be on the line above.
Farther down:
Is this longer than 80 characters? Not sure, just looking at the patch...
e) I don't think this is a good idea:
Functions need to start with a plain text (i.e. no @directive) one line description. So this should be "See registry_update()." rather than using @see. Or better yet: "Does the work for registry_update()." so that it describes what the function does.
f) Missed one place to split into two @see:
(actually, the next couple of these are the same)
g) This should be on two lines:
Same with the next patch section.
h) field.api.php section: Needs blank line before each @see block.
Comment #38
jhodgdonRegarding the form.inc stuff in #36 -- leave it as-is, since it is documentation on how to document form builder functions. Supposedly/hopefully, the \ before @see will escape the @.
Comment #39
aspilicious commentedSecond try, hopefully this one is OK (but I doubt it :) )
Comment #40
aspilicious commentedComment #42
aspilicious commented#39: fixAtSeeV2.patch queued for re-testing.
Comment #43
jhodgdonLooks mostly good!
A couple of items still:
a)
Probably needs . at end of sentence here?
Here also:
And here:
b) WTF?
Probably the REGIONS_ALL flag means "Return all regions." not "visible"? Otherwise it looks like it is the same as REGIONS_VISIBLE? Someone should verify this...
c) You should remove the .project section at the end of the patch file... :)
Comment #44
aspilicious commenteda) fixed
b) fixed (I guess you're right, we have to leave visible away)
c) ... eclipse sneaked that file in....
Comment #45
jhodgdonNote on (b) -- I looked at the code using this flag, and definitely REGIONS_ALL does mean to return all regions (not just the visible ones) in system_region_list().
Nice work, and thanks for your persistence!
Comment #46
dries commentedCommitted this monster patch. Great job. :)