From 3228f7789ca72e04385b0ff9e337d4fe0b87a483 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Mon, 23 Jun 2014 04:12:26 +1000 Subject: [PATCH] Remove the `ArcanistScalaSBTLinter` Summary: As discussed in D9097, the `ArcanistScalaSBTLinter` isn't //really// a linter. Eventually we should add support for a proper Scala linter, but I think that supporting the `ArcanistScalaSBTLinter` as-is is more effort than it is worth. Test Plan: N/A Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D9664 --- src/__phutil_library_map__.php | 2 - src/lint/linter/ArcanistScalaSBTLinter.php | 108 --------------------- 2 files changed, 110 deletions(-) delete mode 100644 src/lint/linter/ArcanistScalaSBTLinter.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index dbb4066d..cb463a70 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -154,7 +154,6 @@ phutil_register_library_map(array( 'ArcanistRevertWorkflow' => 'workflow/ArcanistRevertWorkflow.php', 'ArcanistRubyLinter' => 'lint/linter/ArcanistRubyLinter.php', 'ArcanistRubyLinterTestCase' => 'lint/linter/__tests__/ArcanistRubyLinterTestCase.php', - 'ArcanistScalaSBTLinter' => 'lint/linter/ArcanistScalaSBTLinter.php', 'ArcanistScriptAndRegexLinter' => 'lint/linter/ArcanistScriptAndRegexLinter.php', 'ArcanistSetConfigWorkflow' => 'workflow/ArcanistSetConfigWorkflow.php', 'ArcanistSettings' => 'configuration/ArcanistSettings.php', @@ -328,7 +327,6 @@ phutil_register_library_map(array( 'ArcanistRevertWorkflow' => 'ArcanistBaseWorkflow', 'ArcanistRubyLinter' => 'ArcanistExternalLinter', 'ArcanistRubyLinterTestCase' => 'ArcanistArcanistLinterTestCase', - 'ArcanistScalaSBTLinter' => 'ArcanistExternalLinter', 'ArcanistScriptAndRegexLinter' => 'ArcanistLinter', 'ArcanistSetConfigWorkflow' => 'ArcanistBaseWorkflow', 'ArcanistShellCompleteWorkflow' => 'ArcanistBaseWorkflow', diff --git a/src/lint/linter/ArcanistScalaSBTLinter.php b/src/lint/linter/ArcanistScalaSBTLinter.php deleted file mode 100644 index 80483310..00000000 --- a/src/lint/linter/ArcanistScalaSBTLinter.php +++ /dev/null @@ -1,108 +0,0 @@ -getDeprecatedConfiguration('lint.scala_sbt.prefix'); - $bin = 'sbt'; - - if ($prefix) { - return $prefix.'/'.$bin; - } else { - return $bin; - } - } - - public function getVersion() { - // NOTE: `sbt --version` returns a non-zero exit status. - list($err, $stdout) = exec_manual( - '%C --version', - $this->getExecutableCommand()); - - $matches = array(); - $regex = '/^sbt launcher version (?P\d+\.\d+\.\d+)$/'; - if (preg_match($regex, $stdout, $matches)) { - return $matches['version']; - } else { - return false; - } - } - - public function getInstallInstructions() { - return pht( - 'Check for installation instructions.'); - } - - public function shouldExpectCommandErrors() { - return true; - } - - protected function getMandatoryFlags() { - return array( - '-Dsbt.log.noformat=true', - 'compile', - ); - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - $lines = phutil_split_lines($stdout, false); - $messages = array(); - - foreach ($lines as $line) { - $matches = null; - $regex = '/\[(warn|error)\] (.*?):(\d+): (.*?)$/'; - if (!preg_match($regex, $line, $matches)) { - continue; - } - foreach ($matches as $key => $match) { - $matches[$key] = trim($match); - } - - $message = new ArcanistLintMessage(); - $message->setPath($matches[2]); - $message->setLine($matches[3]); - $message->setCode($this->getLinterName()); - $message->setDescription($matches[4]); - - switch ($matches[1]) { - case 'error': - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR); - break; - case 'warn': - $message->setSeverity(ArcanistLintSeverity::SEVERITY_WARNING); - break; - default: - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ADVICE); - break; - } - - $messages[] = $message; - } - - return $messages; - } - -}