mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 06:42:41 +01:00
Update CSSLint bindings for v0.10.0
Summary: See <https://github.com/facebook/arcanist/pull/131> It looks like the behaviour of csslint has changed since the ArcanistCSSLintLinter was written. Consequently, ArcanistCSSLintLinter does not work with the latest version of csslint (v0.10.0). - `csslint` has a non-zero exit status - Fixed `csslint` parsing for v0.10.0 Reviewed by: epriestley
This commit is contained in:
parent
13fd0a5ef1
commit
bd6cc6b946
1 changed files with 5 additions and 1 deletions
|
@ -51,6 +51,10 @@ final class ArcanistCSSLintLinter extends ArcanistExternalLinter {
|
||||||
return pht('Install CSSLint using `npm install -g csslint`.');
|
return pht('Install CSSLint using `npm install -g csslint`.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function shouldExpectCommandErrors() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
protected function parseLinterOutput($path, $err, $stdout, $stderr) {
|
protected function parseLinterOutput($path, $err, $stdout, $stderr) {
|
||||||
$report_dom = new DOMDocument();
|
$report_dom = new DOMDocument();
|
||||||
$ok = @$report_dom->loadXML($stdout);
|
$ok = @$report_dom->loadXML($stdout);
|
||||||
|
@ -82,7 +86,7 @@ final class ArcanistCSSLintLinter extends ArcanistExternalLinter {
|
||||||
$message->setDescription($child->getAttribute('reason'));
|
$message->setDescription($child->getAttribute('reason'));
|
||||||
$message->setSeverity($severity);
|
$message->setSeverity($severity);
|
||||||
|
|
||||||
if ($child->hasAttribute('line')) {
|
if ($child->hasAttribute('line') && $child->getAttribute('line') > 0) {
|
||||||
$line = $lines[$child->getAttribute('line') - 1];
|
$line = $lines[$child->getAttribute('line') - 1];
|
||||||
$text = substr($line, $child->getAttribute('char') - 1);
|
$text = substr($line, $child->getAttribute('char') - 1);
|
||||||
$message->setOriginalText($text);
|
$message->setOriginalText($text);
|
||||||
|
|
Loading…
Reference in a new issue