Changeset View
Changeset View
Standalone View
Standalone View
src/lint/renderer/ArcanistLintJSONRenderer.php
| <?php | <?php | ||||
| /** | /** | ||||
| * Shows lint messages to the user. | * Shows lint messages to the user. | ||||
| * | |||||
| * @group lint | |||||
| */ | */ | ||||
| final class ArcanistLintJSONRenderer extends ArcanistLintRenderer { | final class ArcanistLintJSONRenderer extends ArcanistLintRenderer { | ||||
| const LINES_OF_CONTEXT = 3; | const LINES_OF_CONTEXT = 3; | ||||
| public function renderLintResult(ArcanistLintResult $result) { | public function renderLintResult(ArcanistLintResult $result) { | ||||
| $messages = $result->getMessages(); | $messages = $result->getMessages(); | ||||
| $path = $result->getPath(); | $path = $result->getPath(); | ||||
| $data = explode("\n", $result->getData()); | $data = explode("\n", $result->getData()); | ||||
| array_unshift($data, ''); // make the line numbers work as array indices | array_unshift($data, ''); // make the line numbers work as array indices | ||||
| Show All 10 Lines | public function renderLintResult(ArcanistLintResult $result) { | ||||
| } | } | ||||
| return json_encode($output)."\n"; | return json_encode($output)."\n"; | ||||
| } | } | ||||
| public function renderOkayResult() { | public function renderOkayResult() { | ||||
| return ''; | return ''; | ||||
| } | } | ||||
| } | } | ||||