diff --git a/src/lint/linter/standards/phutil/ArcanistPhutilXHPASTLinterStandard.php b/src/lint/linter/standards/phutil/ArcanistPhutilXHPASTLinterStandard.php index 17547476..77560d11 100644 --- a/src/lint/linter/standards/phutil/ArcanistPhutilXHPASTLinterStandard.php +++ b/src/lint/linter/standards/phutil/ArcanistPhutilXHPASTLinterStandard.php @@ -56,12 +56,14 @@ final class ArcanistPhutilXHPASTLinterStandard } public function getLinterSeverityMap() { - $advice = ArcanistLintSeverity::SEVERITY_ADVICE; - $error = ArcanistLintSeverity::SEVERITY_ERROR; + $advice = ArcanistLintSeverity::SEVERITY_ADVICE; + $error = ArcanistLintSeverity::SEVERITY_ERROR; + $warning = ArcanistLintSeverity::SEVERITY_WARNING; return array( - ArcanistTodoCommentXHPASTLinterRule::ID => $advice, - ArcanistCommentSpacingXHPASTLinterRule::ID => $error, + ArcanistTodoCommentXHPASTLinterRule::ID => $advice, + ArcanistCommentSpacingXHPASTLinterRule::ID => $error, + ArcanistRaggedClassTreeEdgeXHPASTLinterRule::ID => $warning, ); } diff --git a/src/workflow/ArcanistDownloadWorkflow.php b/src/workflow/ArcanistDownloadWorkflow.php index 66fa7331..543b715e 100644 --- a/src/workflow/ArcanistDownloadWorkflow.php +++ b/src/workflow/ArcanistDownloadWorkflow.php @@ -83,6 +83,7 @@ EOTEXT $display_name = 'F'.$id; $is_show = $this->show; $save_as = $this->saveAs; + $path = null; try { $file = $conduit->callMethodSynchronous( @@ -186,7 +187,7 @@ EOTEXT throw new Exception( pht( 'Got HTTP %d status response, expected HTTP 200.', - $status)); + $status->getStatusCode())); } if (strlen($data)) { @@ -232,6 +233,14 @@ EOTEXT return 0; } catch (Exception $ex) { + + // If we created an empty file, clean it up. + if (!$is_show) { + if ($path !== null) { + Filesystem::remove($path); + } + } + // If we fail for any reason, fall back to the older mechanism using // "file.info" and "file.download". }