1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 00:02:40 +01:00

arc lint: include lint errors in unresolved messages

Summary:
Currently, when arc-lint processes lint warnings and errors, it
accumulates the warnings into an "unresolvedMessages" array.  As
soon as it sees an errors, it breaks out of the loop that does the
collection and returns, causing individual lint errors messages to
not show up in differential.

This diff collects all lint warning and error messages into the
unresolved array.

Test Plan:
arc-diff on patch that had lint errors.  Verified that,
after this change, linte errors messages showed in differential.

Reviewed By: epriestley
Reviewers: jungejason, epriestley
Commenters: jungejason
CC: aran, epriestley, jungejason
Differential Revision: 543
This commit is contained in:
Andrew Gallagher 2011-06-27 13:29:36 -07:00
parent a30a9a8353
commit 3715266209

View file

@ -259,24 +259,33 @@ EOTEXT
}
$unresolved = array();
$result_code = self::RESULT_OKAY;
$has_warnings = false;
$has_errors = false;
foreach ($results as $result) {
foreach ($result->getMessages() as $message) {
if (!$message->isPatchApplied()) {
if ($message->isError()) {
$result_code = self::RESULT_ERRORS;
break;
$has_errors = true;
} else if ($message->isWarning()) {
if ($result_code != self::RESULT_ERRORS) {
$result_code = self::RESULT_WARNINGS;
$has_warnings = true;
}
$unresolved[] = $message;
}
}
}
}
$this->unresolvedMessages = $unresolved;
// Take the most severe lint message severity and use that
// as the result code.
if ($has_errors) {
$result_code = self::RESULT_ERRORS;
} else if ($has_warnings) {
$result_code = self::RESULT_WARNINGS;
} else {
$result_code = self::RESULT_OKAY;
}
if (!$this->getParentWorkflow()) {
if ($result_code == self::RESULT_OKAY) {
echo phutil_console_format(