1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-02-02 09:58:23 +01:00

Fix custom severity rules not being applied

Summary: It seems that `severity.rules` does not override the default linter severities set by the `ArcanistLinter` itself. This seems incorrect and counter-intuitive.

Test Plan: Created a `"severity.rules": { "(.*)": "disabled" }"` configuration and verified that it was being applied.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10475
This commit is contained in:
Joshua Spence 2014-09-11 23:39:12 +10:00
parent 679c13b1b0
commit 75ad848b9d

View file

@ -192,17 +192,17 @@ abstract class ArcanistLinter {
return $map[$code];
}
$map = $this->getLintSeverityMap();
if (isset($map[$code])) {
return $map[$code];
}
foreach ($this->customSeverityRules as $rule => $severity) {
if (preg_match($rule, $code)) {
return $severity;
}
}
$map = $this->getLintSeverityMap();
if (isset($map[$code])) {
return $map[$code];
}
return $this->getDefaultMessageSeverity($code);
}