Summary: Fixes T5300. Currently, if a dead symbolic link is linted, all kinds of errors will be thrown by most linters because they will try to read the (non-existent) file contents. Instead, let's not lint symbolic links by default. In the case that the target of a symbolic link is inside the working copy, then it should be being linted anyway.
Test Plan: Created a symbolic link and verified that it wasn't linted (by any linter other than the `ArcanistFilenameLinter`).
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Maniphest Tasks: T5300
Differential Revision: https://secure.phabricator.com/D9448
return ArcanistDiffUtils::isHeuristicBinaryFile($data);
}
+ final public function isSymbolicLink($path) {
+ return is_link($this->getFilePathOnDisk($path));
+ }
+
final public function getFilePathOnDisk($path) {
return Filesystem::resolvePath(
$path,
return true;
}
+ public function shouldLintSymbolicLinks() {
+ return true;
+ }
+
}
continue;
}
+ if (!$this->shouldLintSymbolicLinks() && $engine->isSymbolicLink($path)) {
+ continue;
+ }
+
$keep[] = $path;
}
return false;
}
+ protected function shouldLintSymbolicLinks() {
+ return false;
+ }
+
/**
* Map a configuration lint code to an `arc` lint code. Primarily, this is
* intended for validation, but can also be used to normalize case or