Summary:
Some linters return absolute path.
It causes separate lint messages for the same file.
Also lint messages aren't properly bound in Phabricator.
I've preferred changing addLintMessage() to fixing all linters because it is
more robust.
Test Plan: arc lint of a file with lint problem from linter using absolute paths
Reviewers: epriestley
Reviewed By: epriestley
CC: aran, epriestley
Differential Revision: https://secure.phabricator.com/D1589
}
protected function addLintMessage(ArcanistLintMessage $message) {
+ if (!$this->getEngine()->getCommitHookMode()) {
+ $root = $this->getEngine()->getWorkingCopy()->getProjectRoot();
+ $path = Filesystem::resolvePath($message->getPath(), $root);
+ $message->setPath(Filesystem::readablePath($path, $root));
+ }
$this->messages[] = $message;
return $message;
}
phutil_require_module('arcanist', 'lint/message');
phutil_require_module('arcanist', 'lint/severity');
+phutil_require_module('phutil', 'filesystem');
+
phutil_require_source('ArcanistLinter.php');