diff --git a/src/lint/engine/ArcanistLintEngine.php b/src/lint/engine/ArcanistLintEngine.php index 8ccfd5f9..2ba79fc7 100644 --- a/src/lint/engine/ArcanistLintEngine.php +++ b/src/lint/engine/ArcanistLintEngine.php @@ -190,6 +190,10 @@ abstract class ArcanistLintEngine { return ArcanistDiffUtils::isHeuristicBinaryFile($data); } + final public function isSymbolicLink($path) { + return is_link($this->getFilePathOnDisk($path)); + } + final public function getFilePathOnDisk($path) { return Filesystem::resolvePath( $path, diff --git a/src/lint/linter/ArcanistFilenameLinter.php b/src/lint/linter/ArcanistFilenameLinter.php index 40d63250..59d38c00 100644 --- a/src/lint/linter/ArcanistFilenameLinter.php +++ b/src/lint/linter/ArcanistFilenameLinter.php @@ -49,4 +49,8 @@ final class ArcanistFilenameLinter extends ArcanistLinter { return true; } + public function shouldLintSymbolicLinks() { + return true; + } + } diff --git a/src/lint/linter/ArcanistLinter.php b/src/lint/linter/ArcanistLinter.php index 60cc53f1..410f0903 100644 --- a/src/lint/linter/ArcanistLinter.php +++ b/src/lint/linter/ArcanistLinter.php @@ -148,6 +148,10 @@ abstract class ArcanistLinter { continue; } + if (!$this->shouldLintSymbolicLinks() && $engine->isSymbolicLink($path)) { + continue; + } + $keep[] = $path; } @@ -442,6 +446,10 @@ abstract class ArcanistLinter { 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