Closed (duplicate)
Project:
Drupal core
Version:
8.1.x-dev
Component:
tracker.module
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Apr 2012 at 21:06 UTC
Updated:
21 Sep 2015 at 11:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
eiriksmHere's a try
Comment #2
eiriksm...and changing status.
Comment #3
traviscarden commentedGreat job, @eiriksm! A few small things:
This actually return an integer, not an object.
This should be changed to follow our standard convention for formatting lists.
If we remove the line between these comments, they should just be treated as one. i.e. Remove the line break after the first one so it flows right into the second one: "...changed timestamp. We just...".
Comment #4
eiriksmThanks! A new patch is attached, and I think I got the list formatting this time (using drupal cs locally)
Comment #5
traviscarden commentedPerfect! Well done. I'll ask someone else to give it a look now so we can mark it RTBC.
Comment #6
xjmThanks @TravisCarden and @eiriksm; this looks great to me too.
One small suggestion while we are fixing this comment: Generally, core comments should follow fairly strict, prescriptive English grammar and writing standards. In this case, that means not starting the sentence with "And". :) (It's also better to avoid using pronouns like "you" and "we"; see the interface text guidelines.) I'd suggest:
(This will also likely fit on one line.)
Edit: updated the suggested comment.
Comment #7
eiriksmEDIT: Dont mind this. Uploading a new patch in 2mins.
Comment #8
eiriksmNew patch, in the git format-patch version, as first suggested by TravisCarden.
Comment #9
xjmAlright, that looks good to me. Thanks @eiriksm!
Comment #10
jhodgdonHas someone verified that with these changes, the Tracker module actually passes Coder review? I've also asked on the meta issue for clarification of what "coder review" actually means, since the meta issue references quite a few different standards (coder, coder tough love, code sniffer, ...).
Comment #11
xjm@TravisCarden confirmed to me on IRC that he ran drupalcs with the patch applied, which is stricter. At present there isn't actually a D8 version of coder even available, though someone is working on a sandbox. Maybe it would be good to confirm whether someone has tested with that sandbox as well?
CTL is not any part of any of the reviews. The summary in the other issue specifies drupalcs now, I believe.
Comment #12
traviscarden commentedThat's right. I've clarified in the meta issue.
Comment #13
eiriksmJust to clarify: I use drupalcs in my editor as well (as stated in #4), and this patch is based on the code passing drupalcs. Should probably have written that already at the first post to avoid confusion.
Comment #14
xjmI added a comment to #1518116-21: [meta] Make Core pass Coder Review summarizing what I tried to suggest in IRC yesterday (it's possible I wasn't clear). Let's update the issue here with:
In each case note any failures that were not corrected, and why.
Comment #15
xjmSetting back to NR until we can confirm these details. Thanks!
Comment #16
NROTC_Webmaster commentedThis passes coder with the exception of two things that are not accurate. (There is nothing to separate and no trailing space/punctuation)
Additionally line 168 in tracker.module exceeds 80 characters and should probably be changed to two lines. I'm not sure if this is detected by Drupalcs or not.
Comment #17
xjmThanks @NROTC_Webmaster. I agree that line 168 should be rewrapped or rewritten. It's the following inline comment:
Regarding the false positives for the
@see, can we see an issue is filed in coder for this already, file one if not, and then add it to the summary in #1361508: [META] Tracking issue for Coder Advisory Review test issues?Comment #18
NROTC_Webmaster commentedThe issue has been filed and added to the tracker #1539698: False positive for @see
Comment #19
eiriksmSorry about the slow response, had a busy week.
I have now updated the patch with the suggestion in #17. To summarize this patch:
- The directory does not pass Drupal 8 branch test code review before this patch. But it is not itemized. That being said, it also says that the .install file has a critical error, and this patch does not touch tracker.install. Does anyone have a clue as to what that might be?
- The directory passes with the D8 port of coder (i did not get the @see remarks by the way)
- The directory passes Drupal Code sniffer (except the test), with one exception:
333 | WARNING | Line exceeds 80 characters; contains 83 characters
The line is the following:
IMO it is cleaner to keep that on one line, since the following lines are list items. Any thoughts on this?
Comment #20
NROTC_Webmaster commentedI think saying both may be bit redundant instead it could just say
// The user only keeps his or her subscription if the following are true:
or, if you think it is worthwhile to say you could change it to
// Users only keep their subscriptions if both of the following are true:
Comment #21
eiriksmPersonally I think "both" should be there. But suggestion #2 is under 80 characters, so let's go with that.
New patch attached.
Comment #22
xjmWe should not ever go over 80 characters in a comment line, no matter what. The only exception is with content within a
@code/@endcodecode snippet where a line of sample code should not be wrapped according to our coding standards (because then we'd be providing a bad example).Thanks!
Comment #23
jhodgdonThe other exception is for @link/@endlink, which can exceed 80 characters (and if it is going to, put the @link ... @endlink on its own line).
Comment #24
xjmAlright, I reviewed #21 and all those changes look good to me. It sounds like it passes both coder and drupalcs? Was this with the most sensitive settings?
One thought, not a blocker:
Maybe we could further clarify this by storing the result of the
theme()call to a variable above this?Comment #25
eiriksmThat sounds smart. That line was most definitely the one I was the least satisfied with, and it looks better now.
Code passes both drupalcs and coder now.
By the way, should we do cleanup on the test as well? Not many issues found:
Comment #26
xjmYep, definitely should clean up the automated tests as well (although I think that first message there might be incorrect). Thanks @eiriksm!
Comment #27
xjmOh, something to be aware of: in #1512434: Make Aggregator module pass Coder Review we are discussing skipping the addition of datatypes in this sprint, since it is time-consuming to review those, and creating a separate sprint dedicated to that once we finish these.
Comment #28
eiriksmI can see that. Here is a patch without the datatypes. This means it does not pass drupalcs any more, but still passes coder (on "minor" setting).
Two comments about the cleanup of the test:
- Did skip the first message.
- The two function doc issues are on the getInfo and setUp functions. While I could always write something here, this is something a little more universal. After looking at some other tests i can't seem to find that this is documented anywhere else either. Does that mean we should skip that one as well?
Comment #29
xjm@eiriksm -- Aha, you are correct. The current standard is to omit docblocks for
getInfo(),setUp(), andtearDown(). See #338403: Use {@inheritdoc} on all class methods (including tests) for the ongoing debate. ;)Comment #30
dinakaran.ilango commentedi tested the patch in #28 but it is showing the following errors
Comment #31
eiriksmThanks for reviewing.
As I said, this patch was without parameter types (or, I used the word "datatypes") since cleaning up those was suggested to do in a different sprint. Therefore it is also as expected that you get these errors, and I also pointed this out in my comment that accompanied the patch, that is does not pass as it gives parameter type errors.
Setting back to needs review, if we all agree on separating data-type patches and other coding standard patches (like this one)?
Comment #32
xjmAgreed, thanks @eiriksm and @dinathecool. So long as we document the failures are only @param/@return datatypes, that should be good. We are not including the datatypes in this sprint at the request of @jhodgdon, the core committer who will ultimately be reviewing these patches and committing them to core once they are RTBC.
Comment #33
lars toomre commentedI am sad to see that we are delaying the addition of @param/@return datatypes. Does it make sense to create a separate patch for those changes now too since so much of the work already was done?
Comment #34
jhodgdonRE #33 - sorry... you could make a patch but since it will probably be a while before it's committed, it probably won't apply by then.
Just as a note... The data types were also left out of the API Docs Cleanup initiative for the same reason. I really don't think they will *ever* be done in all of Core, because these coder and API docs initiatives were difficult enough (we've been doing the API cleanup since I think November), and adding data types will be a MUCH harder thing to accomplish (patch making and reviewing both), since (as I said above) it really means that at least 3 people (patch writer, reviewer, committer) need to read carefully through *every* function in every file of core in order to verify that the documented types for parameter and return value are complete and correct. And probably several times for each of the issues, as errors are found/fixed...
Comment #35
lars toomre commentedThank you @jhodgdon. As you know, my key interest since last fall has been getting the type hinting in.
I agree with you that it will be overwhelming to review say, for instance, all the functions in includes files A-C in one go. As the committer who will be committing these @param/@return type hinting patches, perhaps you could give some guidance on the number of functions to target in such a patch? Should we target 5-10 functions in a patch or everything in one file (such as common.inc)?
Comment #36
xjmRe: #35, this is all offtopic for this issue. Let's wait until we have more of the other patches in and then discuss it in its own issue.
Comment #37
jhodgdonHaving hundreds more patches is even worse. I don't know what the solution is. Really I think the problem is rather intractable to fix all the functions in all of core, because it's not something we can do with a script or a casual glance.
Comment #38
traviscarden commentedPostponing till feature freeze. If you want to help in the meantime, please work on the blockers on the meta issue. Thanks!
Comment #39
sphism commentedWe have the go ahead with all these issues again, see #1518116: [meta] Make Core pass Coder Review for more details
Comment #40
visabhishek commentedI have created a patch , Please review
Comment #41
Jalandhar commentedPatch #40 needs reroll.
Comment #42
Jalandhar commentedComment #43
ribelWorking on this at DrupalCon Amsterdam.
Comment #44
ribelComment #45
rpayanmrerolled
Comment #46
xjmThanks for all the work here so far. See #1518116-86: [meta] Make Core pass Coder Review. This issue is postponed until the meta issue is either closed or reopened.
Comment #47
tatarbjClosing in favor of #2571965: [meta] Fix PHP coding standards in core, stage 1. In this issue the coding standards will be fixed on a sniff-per-sniff basis rather than a module-per-module basis.