I'm working on checking all the code snippets from handbook for standards compliance. To make that work, I've created a shell module into which I'm pasting snippet code so I can then check it with coder. It would make life much easier if coder provided a text area in the interface to input arbitrary code for checking.

Comments

sun’s picture

Title: need for interface to input arbitrary code for checking » Add form to test pasted code
Version: 6.x-1.0 » 6.x-2.x-dev

+1

This could be enhanced with a separate button that invokes coder_format on the pasted input, which would reformat the pasted code instead of reviewing it.

stella’s picture

It should be possible I think if you use the patch review text box. The only catch is that you may need to add a "@@..." line like you would have in a properly formatted patch.

Cheers,
Stella

Barrett’s picture

Using the patch checker appears to require at least one file reference and the @@ line. The excerpt below works, but fails (no failure message, just no outcome) if the +++common.inc line is removed

+++ common.inc  (working copy)
@@ -1189,8 +1189,10 @@

  $count[users] = db_result(db_query("SELECT COUNT(*) FROM {users}"));
  $count[topics] = db_result(db_query("SELECT COUNT(*) FROM {node} WHERE type = 'forum'"));
  $count[comments] = db_result(db_query("SELECT COUNT(*) FROM {node n}, {comments c} WHERE n.type = 'forum' AND n.nid = c.nid"));

  $output = "<p>";
  $output .= t("%count_users  online user, %forum_topics topics and %forum_comments posts on the forum", array('%count_users' => $count[users], '%forum_topics' => $count[topics], '%forum_comments' => $count[comments]));
  $output .= "</p>";
  return $output;
klausi’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Coder for Drupal 6 is now frozen and only security fixes will be applied. Feel free to update this issue and reopen against 7.x-2.x or 8.x-2.x.