mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-25 16:22:42 +01:00
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
This commit is contained in:
parent
60d879fc8c
commit
3228f7789c
2 changed files with 0 additions and 110 deletions
|
@ -154,7 +154,6 @@ phutil_register_library_map(array(
|
||||||
'ArcanistRevertWorkflow' => 'workflow/ArcanistRevertWorkflow.php',
|
'ArcanistRevertWorkflow' => 'workflow/ArcanistRevertWorkflow.php',
|
||||||
'ArcanistRubyLinter' => 'lint/linter/ArcanistRubyLinter.php',
|
'ArcanistRubyLinter' => 'lint/linter/ArcanistRubyLinter.php',
|
||||||
'ArcanistRubyLinterTestCase' => 'lint/linter/__tests__/ArcanistRubyLinterTestCase.php',
|
'ArcanistRubyLinterTestCase' => 'lint/linter/__tests__/ArcanistRubyLinterTestCase.php',
|
||||||
'ArcanistScalaSBTLinter' => 'lint/linter/ArcanistScalaSBTLinter.php',
|
|
||||||
'ArcanistScriptAndRegexLinter' => 'lint/linter/ArcanistScriptAndRegexLinter.php',
|
'ArcanistScriptAndRegexLinter' => 'lint/linter/ArcanistScriptAndRegexLinter.php',
|
||||||
'ArcanistSetConfigWorkflow' => 'workflow/ArcanistSetConfigWorkflow.php',
|
'ArcanistSetConfigWorkflow' => 'workflow/ArcanistSetConfigWorkflow.php',
|
||||||
'ArcanistSettings' => 'configuration/ArcanistSettings.php',
|
'ArcanistSettings' => 'configuration/ArcanistSettings.php',
|
||||||
|
@ -328,7 +327,6 @@ phutil_register_library_map(array(
|
||||||
'ArcanistRevertWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistRevertWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
'ArcanistRubyLinter' => 'ArcanistExternalLinter',
|
'ArcanistRubyLinter' => 'ArcanistExternalLinter',
|
||||||
'ArcanistRubyLinterTestCase' => 'ArcanistArcanistLinterTestCase',
|
'ArcanistRubyLinterTestCase' => 'ArcanistArcanistLinterTestCase',
|
||||||
'ArcanistScalaSBTLinter' => 'ArcanistExternalLinter',
|
|
||||||
'ArcanistScriptAndRegexLinter' => 'ArcanistLinter',
|
'ArcanistScriptAndRegexLinter' => 'ArcanistLinter',
|
||||||
'ArcanistSetConfigWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistSetConfigWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
'ArcanistShellCompleteWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistShellCompleteWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in a new issue