Page MenuHomePhabricator

D7958.diff
No OneTemporary

D7958.diff

diff --git a/src/lint/linter/ArcanistBaseXHPASTLinter.php b/src/lint/linter/ArcanistBaseXHPASTLinter.php
--- a/src/lint/linter/ArcanistBaseXHPASTLinter.php
+++ b/src/lint/linter/ArcanistBaseXHPASTLinter.php
@@ -9,7 +9,7 @@
private $trees = array();
private $exceptions = array();
- protected final function raiseLintAtToken(
+ final protected function raiseLintAtToken(
XHPASTToken $token,
$code,
$desc,
@@ -22,7 +22,7 @@
$replace);
}
- protected final function raiseLintAtNode(
+ final protected function raiseLintAtNode(
XHPASTNode $node,
$code,
$desc,
diff --git a/src/lint/linter/ArcanistExternalLinter.php b/src/lint/linter/ArcanistExternalLinter.php
--- a/src/lint/linter/ArcanistExternalLinter.php
+++ b/src/lint/linter/ArcanistExternalLinter.php
@@ -324,7 +324,7 @@
* @return string Command to execute the raw linter.
* @task exec
*/
- protected function getExecutableCommand() {
+ final protected function getExecutableCommand() {
$this->checkBinaryConfiguration();
$interpreter = null;
@@ -351,7 +351,7 @@
* @return list<string> Composed flags.
* @task exec
*/
- protected function getCommandFlags() {
+ final protected function getCommandFlags() {
$mandatory_flags = $this->getMandatoryFlags();
if (!is_array($mandatory_flags)) {
phutil_deprecated(
@@ -394,7 +394,7 @@
return csprintf('%s', $path);
}
- protected function buildFutures(array $paths) {
+ final protected function buildFutures(array $paths) {
$executable = $this->getExecutableCommand();
$bin = csprintf('%C %Ls', $executable, $this->getCommandFlags());
@@ -420,7 +420,7 @@
return $futures;
}
- protected function resolveFuture($path, Future $future) {
+ final protected function resolveFuture($path, Future $future) {
list($err, $stdout, $stderr) = $future->resolve();
if ($err && !$this->shouldExpectCommandErrors()) {
$future->resolvex();
diff --git a/src/lint/linter/ArcanistFutureLinter.php b/src/lint/linter/ArcanistFutureLinter.php
--- a/src/lint/linter/ArcanistFutureLinter.php
+++ b/src/lint/linter/ArcanistFutureLinter.php
@@ -7,11 +7,11 @@
abstract protected function buildFutures(array $paths);
abstract protected function resolveFuture($path, Future $future);
- protected function getFuturesLimit() {
+ final protected function getFuturesLimit() {
return 8;
}
- public function willLintPaths(array $paths) {
+ final public function willLintPaths(array $paths) {
$limit = $this->getFuturesLimit();
$this->futures = Futures(array())->limit($limit);
foreach ($this->buildFutures($paths) as $path => $future) {
@@ -19,10 +19,9 @@
}
}
- public function lintPath($path) {
- }
+ final public function lintPath($path) {}
- public function didRunLinters() {
+ final public function didRunLinters() {
if ($this->futures) {
foreach ($this->futures as $path => $future) {
$this->willLintPath($path);
diff --git a/src/lint/linter/ArcanistLinter.php b/src/lint/linter/ArcanistLinter.php
--- a/src/lint/linter/ArcanistLinter.php
+++ b/src/lint/linter/ArcanistLinter.php
@@ -88,11 +88,11 @@
return $this;
}
- public function getActivePath() {
+ final public function getActivePath() {
return $this->activePath;
}
- public function getOtherLocation($offset, $path = null) {
+ final public function getOtherLocation($offset, $path = null) {
if ($path === null) {
$path = $this->getActivePath();
}
@@ -108,21 +108,21 @@
);
}
- public function stopAllLinters() {
+ final public function stopAllLinters() {
$this->stopAllLinters = true;
return $this;
}
- public function didStopAllLinters() {
+ final public function didStopAllLinters() {
return $this->stopAllLinters;
}
- public function addPath($path) {
+ final public function addPath($path) {
$this->paths[$path] = $path;
return $this;
}
- public function setPaths(array $paths) {
+ final public function setPaths(array $paths) {
$this->paths = $paths;
return $this;
}
@@ -131,7 +131,7 @@
* Filter out paths which this linter doesn't act on (for example, because
* they are binaries and the linter doesn't apply to binaries).
*/
- private function filterPaths($paths) {
+ final private function filterPaths($paths) {
$engine = $this->getEngine();
$keep = array();
@@ -154,16 +154,16 @@
return $keep;
}
- public function getPaths() {
+ final public function getPaths() {
return $this->filterPaths(array_values($this->paths));
}
- public function addData($path, $data) {
+ final public function addData($path, $data) {
$this->data[$path] = $data;
return $this;
}
- protected function getData($path) {
+ final protected function getData($path) {
if (!array_key_exists($path, $this->data)) {
$this->data[$path] = $this->getEngine()->loadData($path);
}
@@ -175,7 +175,7 @@
return $this;
}
- protected function getEngine() {
+ final protected function getEngine() {
return $this->engine;
}
@@ -183,11 +183,11 @@
return 0;
}
- public function getLintMessageFullCode($short_code) {
+ final public function getLintMessageFullCode($short_code) {
return $this->getLinterName().$short_code;
}
- public function getLintMessageSeverity($code) {
+ final public function getLintMessageSeverity($code) {
$map = $this->customSeverityMap;
if (isset($map[$code])) {
return $map[$code];
@@ -211,12 +211,12 @@
return ArcanistLintSeverity::SEVERITY_ERROR;
}
- public function isMessageEnabled($code) {
+ final public function isMessageEnabled($code) {
return ($this->getLintMessageSeverity($code) !==
ArcanistLintSeverity::SEVERITY_DISABLED);
}
- public function getLintMessageName($code) {
+ final public function getLintMessageName($code) {
$map = $this->getLintNameMap();
if (isset($map[$code])) {
return $map[$code];
@@ -224,7 +224,7 @@
return "Unknown lint message!";
}
- protected function addLintMessage(ArcanistLintMessage $message) {
+ final protected function addLintMessage(ArcanistLintMessage $message) {
if (!$this->getEngine()->getCommitHookMode()) {
$root = $this->getEngine()->getWorkingCopy()->getProjectRoot();
$path = Filesystem::resolvePath($message->getPath(), $root);
@@ -234,11 +234,11 @@
return $message;
}
- public function getLintMessages() {
+ final public function getLintMessages() {
return $this->messages;
}
- protected function raiseLintAtLine(
+ final protected function raiseLintAtLine(
$line,
$char,
$code,
@@ -260,14 +260,14 @@
return $this->addLintMessage($message);
}
- protected function raiseLintAtPath(
+ final protected function raiseLintAtPath(
$code,
$desc) {
return $this->raiseLintAtLine(null, null, $code, $desc, null, null);
}
- protected function raiseLintAtOffset(
+ final protected function raiseLintAtOffset(
$offset,
$code,
$desc,
@@ -316,7 +316,7 @@
// This is a hook.
}
- protected function isCodeEnabled($code) {
+ final protected function isCodeEnabled($code) {
$severity = $this->getLintMessageSeverity($code);
return $this->getEngine()->isSeverityEnabled($severity);
}
diff --git a/src/lint/linter/ArcanistXMLLinter.php b/src/lint/linter/ArcanistXMLLinter.php
--- a/src/lint/linter/ArcanistXMLLinter.php
+++ b/src/lint/linter/ArcanistXMLLinter.php
@@ -30,10 +30,6 @@
return LIBXML_VERSION;
}
- public function getLintMessageName($code) {
- return 'LibXML Error';
- }
-
public function lintPath($path) {
libxml_use_internal_errors(true);
libxml_clear_errors();
@@ -49,7 +45,7 @@
$message->setLine($error->line);
$message->setChar($error->column ? $error->column : null);
$message->setCode($this->getLintMessageFullCode($error->code));
- $message->setName($this->getLintMessageName($error->code));
+ $message->setName('LibXML Error');
$message->setDescription(trim($error->message));
switch ($error->level) {

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 20, 10:30 AM (4 d, 18 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7712954
Default Alt Text
D7958.diff (8 KB)

Event Timeline