From 0f35d03d29800c310317d2c65a16dc7abb2623da Mon Sep 17 00:00:00 2001 From: Chris Piro Date: Wed, 16 Nov 2011 21:53:47 -0800 Subject: [PATCH] don't stopAllLinters() for disabled error Summary: if we don't care and don't expect it to break all other linters then continue Test Plan: ##arc lint --trace## on a commit with non-ascii characters, saw other linters continue Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley, cpiro Differential Revision: 1122 --- src/lint/linter/base/ArcanistLinter.php | 5 +++++ src/lint/linter/text/ArcanistTextLinter.php | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lint/linter/base/ArcanistLinter.php b/src/lint/linter/base/ArcanistLinter.php index 4b3bbe23..67bfd6c0 100644 --- a/src/lint/linter/base/ArcanistLinter.php +++ b/src/lint/linter/base/ArcanistLinter.php @@ -104,6 +104,11 @@ abstract class ArcanistLinter { return ArcanistLintSeverity::SEVERITY_ERROR; } + public function isMessageEnabled($code) { + return ($this->getLintMessageSeverity($code) !== + ArcanistLintSeverity::SEVERITY_DISABLED); + } + public function getLintMessageName($code) { $map = $this->getLintNameMap(); if (isset($map[$code])) { diff --git a/src/lint/linter/text/ArcanistTextLinter.php b/src/lint/linter/text/ArcanistTextLinter.php index 5946d993..a3c1df30 100644 --- a/src/lint/linter/text/ArcanistTextLinter.php +++ b/src/lint/linter/text/ArcanistTextLinter.php @@ -101,7 +101,9 @@ class ArcanistTextLinter extends ArcanistLinter { self::LINT_DOS_NEWLINE, 'You must use ONLY Unix linebreaks ("\n") in source code.', "\r"); - $this->stopAllLinters(); + if ($this->isMessageEnabled(self::LINT_DOS_NEWLINE)) { + $this->stopAllLinters(); + } } } @@ -170,7 +172,9 @@ class ArcanistTextLinter extends ArcanistLinter { $string); } - $this->stopAllLinters(); + if ($this->isMessageEnabled(self::LINT_BAD_CHARSET)) { + $this->stopAllLinters(); + } } protected function lintTrailingWhitespace($path) {