]> khamidou — GitHub mirrors - arcanist.git/commitdiff
When a file doesn't begin "<?php", raise one warning, not one for each line
authorepriestley <git@epriestley.com>
Thu, 8 Mar 2012 01:52:46 +0000 (17:52 -0800)
committerepriestley <git@epriestley.com>
Thu, 8 Mar 2012 01:52:46 +0000 (17:52 -0800)
Summary: Linter flipped out on D1817; reign it in.

Test Plan: Ran "arc lint" on D1817, got one message.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley
Differential Revision: https://secure.phabricator.com/D1818

src/lint/linter/xhpast/ArcanistXHPASTLinter.php
src/lint/linter/xhpast/__tests__/data/php-tags-bad.lint-test

index 9e1295419472a9c8fb69e1237aeb6c2a4a6fa087..1b9b7d865be6f78f5b17ae88084d1cc43de255da 100644 (file)
@@ -686,6 +686,7 @@ final class ArcanistXHPASTLinter extends ArcanistLinter {
             'PHP files should start with "<?php", which may be preceded by '.
             'a "#!" line for scripts.');
         }
+        break;
       }
     }
     foreach ($tokens as $token) {
index 7f71ef9f9ab50936df8a408ee50d35fcf55beec5..c1364ffa03e788055df2bc03864cab23878f32d4 100644 (file)
@@ -4,11 +4,9 @@ garbage garbage
 ?>
 ~~~~~~~~~~
 error:1:1
-error:2:1
 error:4:1
 ~~~~~~~~~~
 garbage garbage
-<?php
-
+<?
 
 ?>