From 58302432cc5fdc3c191ef20bf104b6f803b6731d Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Fri, 17 Jul 2015 16:40:45 +1000 Subject: [PATCH] Fix brace formatting linter rule Summary: Fixes T8847. Test Plan: Ran `arc lint` on a test file: ```lang=php getSurroundingNonsemanticTokens(); + if (!$before) { $first = head($tokens); @@ -39,6 +40,7 @@ final class ArcanistBraceFormattingXHPASTLinterRule ' '.$first->getValue()); } else if (count($before) === 1) { $before = reset($before); + if ($before->getValue() !== ' ') { $this->raiseLintAtToken( $before, @@ -78,7 +80,7 @@ final class ArcanistBraceFormattingXHPASTLinterRule } list($before, $after) = $list->getSurroundingNonsemanticTokens(); if (!$before) { - $first = last($tokens); + $first = head($tokens); $this->raiseLintAtToken( $first,