]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Remove the `ArcanistScalaSBTLinter`
authorJoshua Spence <josh@joshuaspence.com>
Sun, 22 Jun 2014 18:12:26 +0000 (04:12 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Sun, 22 Jun 2014 18:12:26 +0000 (04:12 +1000)
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
src/lint/linter/ArcanistScalaSBTLinter.php [deleted file]

index dbb4066d98110cb4f8d7b84d72691e9b9fc4ec5e..cb463a70ce0df52b3f4f4b613c06a82622aabcc7 100644 (file)
@@ -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 (file)
index 8048331..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-<?php
-
-/**
- * Uses `sbt compile` to detect various warnings/errors in Scala code.
- */
-final class ArcanistScalaSBTLinter extends ArcanistExternalLinter {
-
-  public function getInfoName() {
-    return 'sbt';
-  }
-
-  public function getInfoURI() {
-    return 'http://www.scala-sbt.org';
-  }
-
-  public function getInfoDescription() {
-    return pht('sbt is a build tool for Scala, Java, and more.');
-  }
-
-  public function getLinterName() {
-    return 'ScalaSBT';
-  }
-
-  public function getLinterConfigurationName() {
-    return 'scala-sbt';
-  }
-
-  public function getDefaultBinary() {
-    $prefix = $this->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<version>\d+\.\d+\.\d+)$/';
-    if (preg_match($regex, $stdout, $matches)) {
-      return $matches['version'];
-    } else {
-      return false;
-    }
-  }
-
-  public function getInstallInstructions() {
-    return pht(
-      'Check <http://www.scala-sbt.org> 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;
-  }
-
-}