Index: coder.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/coder/coder.module,v
retrieving revision 1.88.2.56
diff -u -u -p -r1.88.2.56 coder.module
--- coder.module	21 Sep 2008 14:11:42 -0000	1.88.2.56
+++ coder.module	21 Sep 2008 18:06:01 -0000
@@ -743,6 +743,7 @@ function coder_page_form($form_state) {
             '#reviews' => $reviews,
             '#severity' => $settings['coder_severity'],
             '#filename' => $filename,
+            '#module' => _coder_get_regex_hook_modulename($filename),
             '#patch' => $patch,
           );
           $results = do_coder_reviews($coder_args);
@@ -841,6 +842,16 @@ function coder_page_form($form_state) {
 }
 
 /**
+ * Return the regex to replace hook_ with if #hook is defined in a regex rule
+ */
+function _coder_get_regex_hook_modulename($filename) {
+  if (preg_match('/(.*)\.module$/', $filename, $matches)) {
+    return $matches[1];
+  }
+  return '[a-z0-9]\w+';
+}
+
+/**
  * Add results to form array for display on form page.
  *
  * @param $form
@@ -1440,7 +1451,11 @@ function do_coder_review($coder_args, $r
 function do_coder_review_regex(&$coder_args, $review, $rule, $lines, &$results) {
   if (isset($rule['#value'])) {
     $regexflags = isset($rule['#case-sensitive']) ? '' : 'i';
-    $regex = '/'. $rule['#value'] .'/'. $regexflags;
+    $regex = $rule['#value'];
+    if (isset($rule['#hook'])) {
+      $regex = preg_replace('/hook_', '/'. $coder_args['#module'] .'_', $regex);
+    }
+    $regex = '/'. $regex .'/'. $regexflags;
     $function_regex = isset($rule['#function']) ? '/'. $rule['#function'] .'/' : '';
     $function_not_regex = isset($rule['#function-not']) ? '/'. $rule['#function-not'] .'/' : '';
     $current_function = '';
Index: includes/coder_6x.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/coder/includes/coder_6x.inc,v
retrieving revision 1.17.2.56
@@ -167,17 +167,20 @@ function coder_6x_reviews() {
     ),
     array(
       '#type' => 'regex',
-      '#value' => '_(info)\s*\(\s*\$field',
+      '#value' => '[\s\(]hook_info\s*\(\s*\$field',
+      '#hook' => TRUE,
       '#warning_callback' => '_coder_6x_hook_info_auth_warning',
     ),
     array(
       '#type' => 'regex',
-      '#value' => '_(auth)\s*\(\s*\$user',
+      '#value' => '[\s\(]hook_auth\s*\(\s*\$user',
+      '#hook' => TRUE,
       '#warning_callback' => '_coder_6x_hook_info_auth_warning',
     ),
     array(
       '#type' => 'regex',
-      '#value' => 'function\s+[a-z0-9_]+_(help)\s*\(\s*[^,]+\)',
+      '#value' => 'function\s+hook_help\s*\(\s*[^,]+\)',
+      '#hook' => TRUE,
       '#warning_callback' => '_coder_6x_hook_help_warning',
     ),
     array(
@@ -431,7 +434,8 @@ function coder_6x_reviews() {
     ),
     array(
       '#type' => 'regex',
-      '#value' => 'function\s+[a-z0-9_]+_(access)\s*\(('. $argex .'\s*,\s*)('. $argex .')\s*\)',
+      '#value' => 'function\s+hook_access\s*\(('. $argex .'\s*,\s*)('. $argex .')\s*\)',
+      '#hook' => TRUE,
       '#warning_callback' => '_coder_6x_hook_access_warning',
     ),
     array(
