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

Fix context for lint errors at top of file in JSON renderer

This commit is contained in:
vrana 2012-06-01 23:43:21 -07:00
parent 2a99dc8b38
commit 5d78869de0

View file

@ -41,7 +41,7 @@ final class ArcanistLintJSONRenderer implements ArcanistLintRenderer {
'char' => $message->getChar(), 'char' => $message->getChar(),
'context' => implode("\n", array_slice( 'context' => implode("\n", array_slice(
$data, $data,
$message->getLine() - self::LINES_OF_CONTEXT, max(1, $message->getLine() - self::LINES_OF_CONTEXT),
self::LINES_OF_CONTEXT * 2 + 1 self::LINES_OF_CONTEXT * 2 + 1
)), )),
'description' => $message->getDescription(), 'description' => $message->getDescription(),