Currently, pifr_coder.client.inc is hardcoded to run coder reviews at SEVERITY_MINOR; ie. the strictest setting.

The attached patch modifies this to check for an argument in $test->arguments['coder.severity'], and if the argument is set, uses that value instead of the SEVERITY_MINOR default.

If no ['coder.severity'] argument exists, then it continues to use SEVERITY_MINOR as the default coder severity level.

While this shouldn't change anything in the current testbot implementations, it opens up the door to supporting various custom coder combinations in the future. As an example, I've added a 'severity' field in the Coder parameters form on the 'manual coder' testbot interface I've been working on.

Comments

jthorson’s picture

rfay’s picture

Status: Needs review » Needs work
+++ b/review/coder/pifr_coder.client.inc
@@ -57,7 +57,7 @@ class pifr_client_review_pifr_coder extends pifr_client_review_pifr_drupal {
+      '#severity' => (isset($this->arguments['coder.severity'])) ? $this->arguments['coder.severity'] : SEVERITY_MINOR,

Would (!empty($this->arguments['coder.severity'])) ? ...

would as well? That way we avoid the #fail and message if coder.severity is not set.

Powered by Dreditor.

jthorson’s picture

Hmm ... I'm guessing the 'true' code must always be evaluated, even if the condition is false?

In any case, here's a different approach.

jthorson’s picture

Status: Needs work » Needs review
rfay’s picture

Committed: 076dcc1

Thanks!

jthorson’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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