Add form to test pasted code
Barrett - November 8, 2008 - 21:22
| Project: | Coder |
| Version: | 6.x-2.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
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.

#1
+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.
#2
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
#3
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;