diff --git a/src/lint/renderer/ArcanistLintLikeCompilerRenderer.php b/src/lint/renderer/ArcanistLintLikeCompilerRenderer.php new file mode 100644 index 00000000..53316aa9 --- /dev/null +++ b/src/lint/renderer/ArcanistLintLikeCompilerRenderer.php @@ -0,0 +1,52 @@ +getMessages(); + $path = $result->getPath(); + + foreach ($messages as $message) { + $severity = ArcanistLintSeverity::getStringForSeverity( + $message->getSeverity()); + $line = $message->getLine(); + $code = $message->getCode(); + $description = $message->getDescription(); + $lines[] = sprintf( + "%s:%d:%s (%s) %s\n", + $path, + $line, + $severity, + $code, + $description + ); + } + + return implode('', $lines); + } + + public function renderOkayResult() { + return ""; + } +} diff --git a/src/lint/renderer/__init__.php b/src/lint/renderer/__init__.php index 23f3b960..8837258e 100644 --- a/src/lint/renderer/__init__.php +++ b/src/lint/renderer/__init__.php @@ -12,6 +12,7 @@ phutil_require_module('phutil', 'console'); phutil_require_module('phutil', 'utils'); +phutil_require_source('ArcanistLintJSONRenderer.php'); +phutil_require_source('ArcanistLintLikeCompilerRenderer.php'); phutil_require_source('ArcanistLintRenderer.php'); phutil_require_source('ArcanistLintSummaryRenderer.php'); -phutil_require_source('ArcanistLintJSONRenderer.php'); diff --git a/src/workflow/lint/ArcanistLintWorkflow.php b/src/workflow/lint/ArcanistLintWorkflow.php index 93c82433..b53c87ba 100644 --- a/src/workflow/lint/ArcanistLintWorkflow.php +++ b/src/workflow/lint/ArcanistLintWorkflow.php @@ -74,7 +74,8 @@ EOTEXT 'param' => 'format', 'help' => "With 'summary', show lint warnings in a more compact format. ". - "With 'json', show lint warnings in machine-readable JSON format." + "With 'json', show lint warnings in machine-readable JSON format. ". + "With 'compiler', show lint warnings in suitable for your editor." ), 'advice' => array( 'help' => @@ -196,6 +197,11 @@ EOTEXT case 'summary': $renderer = new ArcanistLintSummaryRenderer(); break; + case 'compiler': + $renderer = new ArcanistLintLikeCompilerRenderer(); + $prompt_patches = false; + $apply_patches = $this->getArgument('apply-patches'); + break; default: $renderer = new ArcanistLintRenderer(); break;