]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Special case ArcanistTextLinter for completely empty files.
authorepriestley <epriestley@phabricator.com>
Tue, 22 Mar 2011 18:08:59 +0000 (11:08 -0700)
committerepriestley <epriestley@phabricator.com>
Tue, 22 Mar 2011 18:09:28 +0000 (11:09 -0700)
src/lint/linter/text/ArcanistTextLinter.php

index 8a54550eba0ef0a8ba95b3c0fdc763887be48777..5946d993b94707d1ba0a62f961d984e3a08b6e5e 100644 (file)
@@ -65,6 +65,12 @@ class ArcanistTextLinter extends ArcanistLinter {
   }
 
   public function lintPath($path) {
+    if (!strlen($this->getData($path))) {
+      // If the file is empty, don't bother; particularly, don't require
+      // the user to add a newline.
+      return;
+    }
+
     $this->lintNewlines($path);
     $this->lintTabs($path);