Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
action.module
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Oct 2012 at 15:17 UTC
Updated:
21 Sep 2015 at 11:53 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedComment #2
lars toomre commented#1802070: Add missing type hinting to Action module docblocks is open to deal separately with any missing type hinting from @param and/or @return directives.
Comment #3
amitgoyal commentedBased on the learnings from #1533244: Make help module pass Coder Review issue, I have made fixes, related to coding standards, in Action module. As per learning there, I have ignored following issues,
- Missing parameter type at position x
- Data type of return value is missing
- If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
- No scope modifier specified for function getInfo() in class files
Attaching a Patch here which will fix the remaining issues. I am also attaching Coder output coder_issues_action_2012_10_22.txt so that we can see the list of all issues.
I am not sure about this particular issue "Data type of return value is missing". Please let me know if I need to fix it.
Comment #4
kars-t commentedThe patch fixes the issues stated in #3.
But the coding standard changed for Drupal 8.
http://drupal.org/node/1354#functions
I am setting this to "needs work" as it seems we now should check if the data type for return is obvious. But I have no clue what "obvious" really means here. Is it obvios if its a very short function? How obvious is an array?
Comment #5
amitgoyal commented@Kars-T - Please see #5 here #1518116: [meta] Make Core pass Coder Review. It's clearly mentioned that "The one exception to the rule is for adding param/return datatypes which will be handled in #1800046: [META] Add missing type hinting to core docblocks, fix Drupal.Commenting.FunctionComment.Missing*".
So changing the status back to 'needs review'.
Comment #6
kars-t commentedAh okay. Than I'd say it is RTBC but as my english is to weak to evaluate the comments I leave the status as it is :)
Comment #7
lars toomre commentedThanks for the patch @amitgoyal. I hope to do a detailed review of this later today.
If you have not seen the comment yet, please take a look at what I added in #1816690-7: Make Ban module pass Coder Review. I would love to see similar reports to what is in #3 for the Node, System and/or Taxonomy modules.
The other thing that would be helpful is to generate a separate patch for #1802070: Add missing type hinting to Action module docblocks that addresses all of the type hinting for @param and @return directives that are highlighted in the report in #3, but not included in the patch for this issue.
As you might be aware, performing a detailed review of type hinting patches for @param and @return directives takes quite a bit of time. Hence, they are being broken out separately, and in the case of modules needing many additions, being added in several incremental patches.
This past weekend I spent considerable time performing such reviews of patches for the Overlay, PHP, Poll, Syslog, Tracker, and Update modules. (Each of those patches were generated without the benefit of an excellent automated report like that in #3).
I would be happy to review any such similar patch(es) that might be generated for the Action module.
Comment #8
traviscarden commentedPostponing till feature freeze. If you want to help in the meantime, please work on the blockers on the meta issue. Thanks!
Comment #9
sphism commentedWe have the go ahead with all these issues again, see #1518116: [meta] Make Core pass Coder Review for more details
Comment #10
pguillard commentedI work on it
Comment #11
pguillard commentedHere is a patch
Comment #12
pfrenssenGreat start, thanks!
This should be "{@inheritdoc}". We are using this in favour of "Overrides xyz". See Comment standards - inheritdoc.
When scanning all files in the action module I still found 3 additional coding standards violations:
$ phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,js,css,info,txt ./core/modules/action FILE: /home/pieter/v/drupal/drupal/core/modules/action/action.module -------------------------------------------------------------------------------- FOUND 1 ERROR(S) AFFECTING 1 LINE(S) -------------------------------------------------------------------------------- 41 | ERROR | Inline doc block comments are not allowed; use "// Comment" | | instead -------------------------------------------------------------------------------- FILE: ...r/v/drupal/drupal/core/modules/action/src/Plugin/Action/EmailAction.php -------------------------------------------------------------------------------- FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S) -------------------------------------------------------------------------------- 161 | WARNING | Line exceeds 80 characters; contains 87 characters -------------------------------------------------------------------------------- FILE: ...er/v/drupal/drupal/core/modules/action/src/Plugin/Action/GotoAction.php -------------------------------------------------------------------------------- FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S) -------------------------------------------------------------------------------- 53 | WARNING | Line exceeds 80 characters; contains 83 characters --------------------------------------------------------------------------------If you could have a look at those as well that would be great.
Comment #13
pguillard commentedThank you.
Remains GotoAction.php Line53, as we encounter an exception for function description
(@ee : https://www.drupal.org/node/1539712#comment-5937986)
Comment #14
pguillard commentedComment #15
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 #16
xjmComment #17
xjmComment #18
tatarbjI've cleaned up the current actions module and attaching the patch file with the changes.
Comment #19
tatarbjComment #21
tatarbjSorry, the previous one was checked out from 8.0.x, the current one should be passed.
Comment #22
tatarbjComment #26
tatarbjI'm putting it back to 8.0.x based on this started discussion and send my patch to review.
https://www.drupal.org/node/1518116
Comment #27
tatarbjComment #29
tatarbjSorry for everyone to make noise here, this patch file will work (i really hope)
Comment #30
daffie commentedAll changes look good to me, accept for this one:
Are you sure about this change?
Comment #31
jaxxed commentedI also get this:
FILE: /app/www/active/core/modules/action/action.module
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
41 | ERROR | Inline doc block comments are not allowed; use "/*
| | Comment */" or "// Comment" instead
----------------------------------------------------------------------
Comment #32
jaxxed commented@daffie : which you're proposed Action.php change, I get a coder issue:
FILE: ...tive/core/modules/action/src/Plugin/migrate/source/d6/Action.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
33 | ERROR | [x] Line indented incorrectly; expected at least 6
| | spaces, found 4
----------------------------------------------------------------------
Comment #33
tatarbjI'm closing the ticket because opened a new one here: #2567357: Make Action module pass Coder Review Please follow it there.
Comment #34
traviscarden commented@tatarbj: It's not standard practice to arbitrarily close or duplicate issues. Valuable information, such as comments, subscribers, and relationships to other issues is all lost when you do. See Use the Issue Queue if you don't understand how it works. If you would like to contribute to this issue, please do so here. Thanks!
Comment #35
traviscarden commented@tatarbj: I just saw #1816690-27: Make Ban module pass Coder Review. The point there was not to re-open closed issues. This issue was still open, so you needn't create a new one. In short: Keep open issues open until fixed. Once fixed, keep closed issues closed. :)
Comment #36
tatarbj@TravidCarden i'm confused what should i do @alexpott asked me to close a similar issue and create a new one here: https://www.drupal.org/node/1816690#comment-10313705
Just to make sure: i shouldn't close issues and open a new one if i want to work on a 3+ years and postponed topic which can be solved by me like all of the d8 core modules what i started to do.
In this case i'm attaching the patch what i've created for the duplicated issue #2567357: Make Action module pass Coder Review
Comment #37
traviscarden commented@tatarbj: The reason @alexpott asked you to open a new issue in #1816690-27: Make Ban module pass Coder Review is because that issue had already been closed. The patch had been committed. The issue was fixed. He was asking you not to re-open closed (fixed) issues. This issue, on the other hand, was already open; so it was appropriate to continue working in it. It should not have been marked fixed because the issue itself was not, in fact, fixed. Does that clear it up? The Status settings of issues handbook page may be of further help, if necessary.
Comment #38
pfrenssenComment #39
pfrenssenClosing 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.