Closed (fixed)
Project:
Git Release Notes for Drush
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
16 May 2011 at 18:37 UTC
Updated:
6 Feb 2012 at 06:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
Grayside commentedImplement validate hook to check that both arguments are not-null.
Comment #2
Josh The Geek commentedIt should return this. drush_set_error always returns false, so you could just prefix the line with return. That way the command will be canceled.
Powered by Dreditor.
Comment #3
Grayside commentedActually if a command validation sets an error it will also halt the command. See drush_invoke_args().
As a coding standard issue, I'm not actually clear on whether it is preferable to return, so I will leave the status alone.
Comment #4
Josh The Geek commentedOh. That makes sense. I'd say it's fine then, so back to needs review. I'll be reviewing patches for grn this weekend.
Comment #5
tr commented"Implementation of" should be "Implements" in the patch to conform with Drupal coding standards.
The message I had in mind would be more like a standard Unix usage message. In this case, something like:
Comment #6
Josh The Geek commentedComment #7
sun"Implements".
1) Always use !isset() instead of is_null().
2) empty() would be much more appropriate here.
Powered by Dreditor.
Comment #8
Grayside commentedOut of curiosity, are we backporting D7 coding standards to D6 projects, or are we just treating this as a D7 project because it should be?
Comment #9
sunDrupal coding standards are version-independent and "always-current". All new code should follow the current standards, regardless of (core) version. Existing code in older versions may be updated, but doesn't necessarily have to be. Especially for larger code-bases (like Drupal core), updating the code of a previous version for current standards may too huge of a task. However, code in current versions should follow the current standards.
Lastly, when following this practice, make sure to not squeeze coding standards updates/clean-ups into otherwise unrelated patches. E.g., as in this case, the diff context in the patch shows another unrelated, old phpDoc summary. To update existing code, always create a separate and dedicated issue + patch.
Comment #10
Josh The Geek commentedsun: Just an fyi, I reposted your comment about coding standards above into #983268-59: Use @implements Doxygen directive for hook implementations, because of the discussion about backporting coding standards.
Comment #11
tr commentedThere's already a patch waiting for review that fixes all the documentation and coding standards issues for this project: #1159380: Coding/Documentation standards
Comment #12
jhodgdonsun asked me on IRC if #9 was correct. I believe it is correct, but I don't know that it's been formalized. We update coding standards regularly but don't usually go back and update past versions of Drupal to follow them (and Coder module generally follows the current standards only in the latest version, which can cause trouble when it's running its checks).
Comment #13
Grayside commentedThis is really good information to make clear. Thank you.
I always thought coding standards were a little bit hazy about this issue, but that ultimately binding a version of the standards to a Drupal core version dependency was a good idea for consistency.
Any case, I'm not specifically claiming ownership of this issue, I will try to cycle back around in the next week or two and push any issue I've touched in grn that needs it.
Comment #14
petsagouris commentedI believe that this actually sums all the patch recommendations nicely, tested on local setup and it works as expected.
Comment #15
Grayside commentedI prefer <start> <end>, though this is likely to change to <end> (<start>)Comment #16
petsagouris commented@ #15: Can you please give me more details on your patch review so that I can fix my patch ?
Comment #17
Grayside commentedSorry, darn corner braces :)
Comment #18
petsagouris commentedI suppose this command usage format is the valid one until #1253356: use two most recent tags as defaults is completely resolved and in the code.
I do realize that we need to use one single reference style for the arguments of the function so that everything is coherent. If it is <start> <end> then I'd be happy to go ahead and fix the patch ;)
Comment #19
Grayside commentedI think those are the most comprehensible to less git-savvy folks at a glance. We can go on to document that start and end refer to git treeishes etc etc in the README and comments.
Comment #20
petsagouris commentedOk, the patch is now using <start> and <end>.
Comment #21
Grayside commentedHehe, never new --help existed! Looks good, will test just to make sure everything is copacetic.
Comment #22
Grayside commentedhttp://drupalcode.org/project/grn.git/commit/d29f595