Page MenuHomePhabricator

D11307.id27217.diff
No OneTemporary

D11307.id27217.diff

diff --git a/src/lint/linter/ArcanistCSSLintLinter.php b/src/lint/linter/ArcanistCSSLintLinter.php
--- a/src/lint/linter/ArcanistCSSLintLinter.php
+++ b/src/lint/linter/ArcanistCSSLintLinter.php
@@ -1,7 +1,7 @@
<?php
/**
- * Uses "CSS Lint" to detect checkstyle errors in css code.
+ * Uses "CSS Lint" to detect checkstyle errors in CSS code.
*/
final class ArcanistCSSLintLinter extends ArcanistExternalLinter {
@@ -14,7 +14,9 @@
}
public function getInfoDescription() {
- return pht('Use `csslint` to detect issues with CSS source files.');
+ return pht(
+ 'Use `%s` to detect issues with CSS source files.',
+ 'csslint');
}
public function getLinterName() {
@@ -51,7 +53,9 @@
}
public function getInstallInstructions() {
- return pht('Install CSSLint using `npm install -g csslint`.');
+ return pht(
+ 'Install %s using `%s`.', 'CSSLint',
+ 'npm install -g csslint');
}
public function shouldExpectCommandErrors() {
@@ -68,12 +72,9 @@
$files = $report_dom->getElementsByTagName('file');
$messages = array();
+
foreach ($files as $file) {
foreach ($file->childNodes as $child) {
- if (!($child instanceof DOMElement)) {
- continue;
- }
-
$data = $this->getData($path);
$lines = explode("\n", $data);
$name = $child->getAttribute('reason');
@@ -81,13 +82,13 @@
? ArcanistLintSeverity::SEVERITY_WARNING
: ArcanistLintSeverity::SEVERITY_ERROR;
- $message = new ArcanistLintMessage();
- $message->setPath($path);
- $message->setLine($child->getAttribute('line'));
- $message->setChar($child->getAttribute('char'));
- $message->setCode('CSSLint');
- $message->setDescription($child->getAttribute('reason'));
- $message->setSeverity($severity);
+ $message = id(new ArcanistLintMessage())
+ ->setPath($path)
+ ->setLine($child->getAttribute('line'))
+ ->setChar($child->getAttribute('char'))
+ ->setCode('CSSLint')
+ ->setSeverity($severity)
+ ->setDescription($child->getAttribute('reason'));
if ($child->hasAttribute('line') && $child->getAttribute('line') > 0) {
$line = $lines[$child->getAttribute('line') - 1];
@@ -103,18 +104,16 @@
}
protected function getLintCodeFromLinterConfigurationKey($code) {
-
// NOTE: We can't figure out which rule generated each message, so we
// can not customize severities. I opened a pull request to add this
// ability; see:
//
// https://github.com/stubbornella/csslint/pull/409
-
throw new Exception(
pht(
- "CSSLint does not currently support custom severity levels, because ".
- "rules can't be identified from messages in output. ".
- "See Pull Request #409."));
+ "%s does not currently support custom severity levels, because ".
+ "rules can't be identified from messages in output.",
+ 'CSSLint'));
}
}

File Metadata

Mime Type
text/plain
Expires
May 20 2024, 3:35 AM (5 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6303212
Default Alt Text
D11307.id27217.diff (2 KB)

Event Timeline