mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-28 17:52:42 +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:
parent
a30a9a8353
commit
3715266209
1 changed files with 16 additions and 7 deletions
|
@ -259,24 +259,33 @@ EOTEXT
|
||||||
}
|
}
|
||||||
|
|
||||||
$unresolved = array();
|
$unresolved = array();
|
||||||
$result_code = self::RESULT_OKAY;
|
$has_warnings = false;
|
||||||
|
$has_errors = false;
|
||||||
|
|
||||||
foreach ($results as $result) {
|
foreach ($results as $result) {
|
||||||
foreach ($result->getMessages() as $message) {
|
foreach ($result->getMessages() as $message) {
|
||||||
if (!$message->isPatchApplied()) {
|
if (!$message->isPatchApplied()) {
|
||||||
if ($message->isError()) {
|
if ($message->isError()) {
|
||||||
$result_code = self::RESULT_ERRORS;
|
$has_errors = true;
|
||||||
break;
|
|
||||||
} else if ($message->isWarning()) {
|
} else if ($message->isWarning()) {
|
||||||
if ($result_code != self::RESULT_ERRORS) {
|
$has_warnings = true;
|
||||||
$result_code = self::RESULT_WARNINGS;
|
|
||||||
}
|
}
|
||||||
$unresolved[] = $message;
|
$unresolved[] = $message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$this->unresolvedMessages = $unresolved;
|
$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 (!$this->getParentWorkflow()) {
|
||||||
if ($result_code == self::RESULT_OKAY) {
|
if ($result_code == self::RESULT_OKAY) {
|
||||||
echo phutil_console_format(
|
echo phutil_console_format(
|
||||||
|
|
Loading…
Reference in a new issue