Summary: D4963 for other linters.
Test Plan: Saw time 0.001 instead of 0.113 in spellcheck linter.
Reviewers: epriestley
Reviewed By: epriestley
CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4965
}
public function willLintPaths(array $paths) {
+ if (!$this->isCodeEnabled(self::JSHINT_ERROR)) {
+ return;
+ }
+
$jshint_bin = $this->getJSHintPath();
$jshint_options = $this->getJSHintOptions();
$futures = array();
}
public function lintPath($path) {
+ if (!$this->isCodeEnabled(self::JSHINT_ERROR)) {
+ return;
+ }
+
list($rc, $stdout, $stderr) = $this->results[$path];
if ($rc === 0) {
}
public function lintPath($path) {
+ $severity = ArcanistLintSeverity::SEVERITY_WARNING;
+
+ if (!$this->getEngine()->isSeverityEnabled($severity)) {
+ return;
+ }
+
$pep8_bin = $this->getPEP8Path();
$options = $this->getPEP8Options();
$message->setCode($matches[4]);
$message->setName('PEP8 '.$matches[4]);
$message->setDescription($matches[5]);
- $message->setSeverity(ArcanistLintSeverity::SEVERITY_WARNING);
+ $message->setSeverity($severity);
$this->addLintMessage($message);
}
}
$root = $tree->getRootNode();
- $this->lintArrayCombine($root);
- $this->lintUnsafeDynamicString($root);
- $this->lintDeprecatedFunctions($root);
+ $method_codes = array(
+ 'lintArrayCombine' => self::LINT_ARRAY_COMBINE,
+ 'lintUnsafeDynamicString' => self::LINT_UNSAFE_DYNAMIC_STRING,
+ 'lintDeprecatedFunctions' => self::LINT_DEPRECATED_FUNCTION,
+ );
+
+ foreach ($method_codes as $method => $codes) {
+ foreach ((array)$codes as $code) {
+ if ($this->isCodeEnabled($code)) {
+ call_user_func(array($this, $method), $root);
+ break;
+ }
+ }
+ }
}
public function lintPath($path) {
foreach ($this->partialWordRules as $severity => $wordlist) {
if ($severity >= $this->severity) {
+ if (!$this->isCodeEnabled($severity)) {
+ continue;
+ }
foreach ($wordlist as $misspell => $correct) {
$this->checkPartialWord($path, $misspell, $correct, $severity);
}
}
}
+
foreach ($this->wholeWordRules as $severity => $wordlist) {
if ($severity >= $this->severity) {
+ if (!$this->isCodeEnabled($severity)) {
+ continue;
+ }
foreach ($wordlist as $misspell => $correct) {
$this->checkWholeWord($path, $misspell, $correct, $severity);
}