// When a user runs "arc diff", we default to raising only warnings on
// lines they have changed (errors are still raised anywhere in the
// file).
- $changed = $this->getPathChangedLines($path);
+ $changed = $this->getPathChangedLines($message->getPath());
if ($changed !== null && !$message->isError()) {
if (empty($changed[$message->getLine()])) {
continue;
class ArcanistDiffWorkflow extends ArcanistBaseWorkflow {
private $hasWarnedExternals = false;
+ private $unresolvedLint;
+ private $unresolvedUnit;
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
'differential.creatediff',
$diff);
+ if ($this->unresolvedLint) {
+ $data = array();
+ foreach ($this->unresolvedLint as $message) {
+ $data[] = array(
+ 'path' => $message->getPath(),
+ 'line' => $message->getLine(),
+ 'char' => $message->getChar(),
+ 'code' => $message->getCode(),
+ 'severity' => $message->getSeverity(),
+ 'name' => $message->getName(),
+ 'description' => $message->getDescription(),
+ );
+ }
+ $conduit->callMethodSynchronous(
+ 'differential.setdiffproperty',
+ array(
+ 'diff_id' => $diff_info['diffid'],
+ 'name' => 'arc:lint',
+ 'data' => json_encode($data),
+ ));
+ }
+
if ($this->shouldOnlyCreateDiff()) {
echo phutil_console_format(
"Created a new Differential diff:\n".
// TODO: This is kind of silly, but 'file -ib' goes crazy on executables.
$mime_type = reset(explode(',', $mime_type));
}
-
+
$result['mime'] = $mime_type;
if (!$continue) {
throw new ArcanistUserAbortException();
}
+ $this->unresolvedLint = $lint_workflow->getUnresolvedMessages();
break;
case ArcanistLintWorkflow::RESULT_ERRORS:
echo phutil_console_format(
const RESULT_ERRORS = 2;
const RESULT_SKIP = 3;
+ private $unresolvedMessages;
+
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
**lint** [__options__] [__paths__] (svn)
}
}
+ $unresolved = array();
$result_code = self::RESULT_OKAY;
foreach ($results as $result) {
foreach ($result->getMessages() as $message) {
$result_code = self::RESULT_ERRORS;
break;
} else if ($message->isWarning()) {
- $result_code = self::RESULT_WARNINGS;
+ if ($result_code != self::RESULT_ERRORS) {
+ $result_code = self::RESULT_WARNINGS;
+ }
+ $unresolved[] = $message;
}
}
}
}
+ $this->unresolvedMessages = $unresolved;
if (!$this->getParentWorkflow()) {
if ($result_code == self::RESULT_OKAY) {
return $result_code;
}
+
+ public function getUnresolvedMessages() {
+ return $this->unresolvedMessages;
+ }
+
}