Problem/Motivation
The changes required for 'Drupal.Commenting.DocComment.ShortSingleLine' are too large and need to be split into child issues.
Proposed resolution
Fix method doc block of non tests for sniff 'Drupal.Commenting.DocComment.ShortSingleLine'.
Remaining tasks
Patch
Review - Instructions for adding the sniff and running the test are in the Issue Summary of #3123060: Enable 'Drupal.Commenting.DocComment.ShortSingleLine' coding standard
Commit
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|
Issue fork drupal-3268835
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3268835-fix-method-comments changes, plain diff MR !3275
Comments
Comment #2
quietone CreditAttribution: quietone at PreviousNext commentedComment #3
Shashwat Purav CreditAttribution: Shashwat Purav at Portage CyberTech for Drupal Association commentedThe patch in #2 applied successfully to 10.0.x branch.
Comment #4
quietone CreditAttribution: quietone at PreviousNext commentedTime for a reroll
Comment #5
ravi.shankar CreditAttribution: ravi.shankar at OpenSense Labs commentedAdded reroll of patch #2 on Drupal 10.0.x. and removed needs reroll tag.
Comment #6
smustgrave CreditAttribution: smustgrave at Mobomo commentedPatch or MR doesn't apply anymore
The last patch or MR doesn't apply to the target branch, please reroll the code so that it can be reviewed by the automated testbot.
Comment #7
smustgrave CreditAttribution: smustgrave at Mobomo commentedRerolled patch for 10.1
Comment #8
borisson_I'm not sure we need to keep this "this is used a lot.", does add any value imho
That is the only nitpick I could find. It was already in there so I think we can keep it like this. This is a good improvement over the current state and brings us closer to being able to enable the CS rule.
Comment #9
xjmThanks for working on this! It will be great to finally have this rule enabled.
I only got halfway through this patch because there are a lot of things in it that are against our documentation standards. Please extrapolate from the below points and also review the function documentation standards to fix similar errors in the second half of the patch. I know cleanups like these are a lot of work because we often have to read the whole method.
We should not make docs fit the 80-character rule by removing articles ("the") or other small words. It's supposed to be a fully grammatical English predicate of 80 characters or less that begins with a third-person indicative verb. Say that five times fast! :)
One option for these is (e.g.):
The
Foo callback: Does blah
format is also a standard that we should not break. "Render API callback" is way too generic to be one-line documentation.Also, the first one isn't over 80 characters; why are we even changing it?
Any subsequent paragraphs in the documentation should use full sentences.
Hm. "Safe to run" is too vague by itself. Maybe:
Again, how are these in scope?
This isn't even method documentation; why is it included?
This should be something like:
The second paragraph here is completely redundant and can be removed.
The second paragraph should again use complete sentences; the subject is missing.
I believe these have a special standard: https://www.drupal.org/docs/develop/standards/php/api-documentation-and-...
It's a bit archaic and based on D7 and earlier when we needed a clear way to group the form builders, validation handlers, and submission handlers together, back before these things were grouped together in, you know, classes. So I'm not sure it applies anymore. Indeed, even with all the forms in core, there are only 13 of these anymore:
So I think this can be something much simpler like:
(We don't need to say it's for the file widget anymore, because it's now in a class called
FileWidget
.)Not a method so outside the current scope.
Wow is that a mouthful. How much wood could a woodchuck chuck, if a woodchuck could chuck wood?
How about:
(Still a mouthful, but not as much.)
This should probably just be
{@inheritdoc}
.Should probably be "This is per...." since it's the second paragraph and therefore needs to be a complete sentence.
(The "given" is implied by the parameter documentation.)
This should start with "Provides".
Also I have no idea what "it will cooperate with other arguments if possible" means.
This should start with "Ensures". I also agree that "This is used a lot" is not needed.
What?
Comment #10
xjmAlso, I suggest converting this issue to a merge request. Then I could use the "suggestion" feature to rewrite the bad docs myself and save a lot of review churn. The workflow is that anyone commenting on emerge request can make a suggestion for how to change it, and then the original author can accept the suggestion, or another reviewer can comment saying +1 for the suggestion and I can apply it with a click of a button. It is one to GitLab feature that is definitely superior to the patch workflow. It is much better for this type of issue than a patch and should save us a lot of time spent on extra long bulleted lists etc.
Comment #12
quietone CreditAttribution: quietone at PreviousNext commentedConverted to an MR as suggested in #10.
The MR has fixes for all the points listed in the review in #9. Item 16 and 17 are not done because core/modules/pgsql/src/Driver/Database/pgsql/Schema.php was deprecated.
Comment #13
smustgrave CreditAttribution: smustgrave at Mobomo commentedTested this out by commenting out the phpcs line and running against changes in the MR.
They all passed locally with that rule disabled.
Comment #14
xjmComment #15
xjmGot further this time, all the way into views. Boy is a lot of this change set in Views...
Again, if you could, please extrapolate and make note of where other docs standards (like the sentence structure and grammar) are not being followed elsewhere in the MR.
Comment #16
quietone CreditAttribution: quietone at PreviousNext commentedComment #17
smustgrave CreditAttribution: smustgrave at Mobomo commentedChanges look good.
Do we need a follow up for EntityFormInterface?
Comment #18
smustgrave CreditAttribution: smustgrave at Mobomo commentedOpened up #3339760: Update archaic standard in comments. for the follow up. Wasn't entirely sure what the grep command was though.
Comment #19
catchSome of the views plugin descriptions are still not readable to me at all, similar to feedback in #9.
Comment #20
quietone CreditAttribution: quietone at PreviousNext commentedTime for reviews again.
Comment #21
smustgrave CreditAttribution: smustgrave at Mobomo commentedThese are not my best will fully admit.
But I took a look at MR 3275 and the changes make sense to me.
Comment #25
longwaveCommitted and pushed to 10.1.x, 10.0.x and 9.5.x. Thanks!
The MR did not apply to 9.5.x in core/lib/Drupal/Core/Routing/Router.php but I skipped that change there because in 9.5.x the docblock was already just @inheritdoc.