Doxygen and comment formatting conventions suggests that comments for hook implementations should be something like


/**
 * Implements hook_help(). 
 */
function blog_help($section) {
  // ...
}

The snippets now use this format and Drupal Code Sniffer issues a warning.

/**
 * Implementation of hook_help()
 */
function blog_help($section) {
  // ...
}

Attached patch replaces old style comments for the ones suggested in the documentation. With this patch Drupal Code Sniffer doesn't complain about the format of the comments.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

benjifisher’s picture

Status: Needs review » Fixed
FileSize
10.13 KB

@mpv:

Thanks for the patch!

Five of the hooks already had ending punctuation, and your patch gave them two periods. For example, + * Implements hook_init()..
I have applied the attached patch.


I think there are still some whitespace issues with the snippets, but this is a step in the right direction, so I am marking this issue as fixed. If you are interested in submitting further patches, please post them to #1839828: Update and add code snippets.

Already committed: 17e5ae3. It will be included in the next release.

benjifisher’s picture

I also updated the on-line documentation: http://drupal.org/node/1389006 and http://drupal.org/node/1407302.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.