Index: includes/coder_style.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/coder/includes/coder_style.i
nc,v
retrieving revision 1.16.2.8
diff -u -r1.16.2.8 coder_style.inc
--- includes/coder_style.inc    30 Jan 2008 10:41:22 -0000      1.16.2.8
+++ includes/coder_style.inc    30 Jan 2008 15:10:03 -0000
@@ -118,6 +118,17 @@
       '#warning' => 'use quotes around a string literal array index, this is no
t only a style issue, but a known performance problem',
       '#case-sensitive' => TRUE,
     ),
+    array(
+      '#type' => 'regex',
+      '#value' => '\s(if|elseif|while|foreach|switch|return|for|catch)\s*\(.*\)
\s*{\s*[^\s]+',
+      '#warning' => 'control statements should be on a separate line',
+    ),
+    array(
+      '#type' => 'regex',
+      '#source' => 'all',
+      '#value' => '\s+$',
+      '#warning' => 'There should be no trailing spaces',
+    ),
   );
   $review = array(
     '#title' => t('Drupal Coding Standards'),
Index: tests/coder_style.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/coder/tests/coder_style.inc,
v
retrieving revision 1.6.2.3
diff -u -r1.6.2.3 coder_style.inc
--- tests/coder_style.inc       9 Jan 2008 13:31:12 -0000       1.6.2.3
+++ tests/coder_style.inc       30 Jan 2008 15:10:04 -0000
@@ -80,5 +80,22 @@
   $a['hello'] = 'this is no';
 }

+function coder_trailing_spaces() {
+  $left = 'this is bad';
+  $left = 'this is ok';
+}
+
+function coder_control_structures() {
+  if($a == 1){ }
+  if ($a == 1) {
+  }else {
+  }
+  if ($a == 1) { $b = 2;
+  }
+  if ($a == 1) {$b = 2;
+  }
+}
+
+
 // Should generate an error about the trailing php close.
 ?>