1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-23 14:00:55 +01:00

Resolve paths when running "--lintall"

Summary: this was all kinds of fail when running from a subdirectory or on
invalid paths. Detect nonexistent paths; resolve valid paths.

Test Plan: ran "arc lint --lintall" on a file from a subdirectory, and on a
file which did not exist. Received patches and an error, respectively

Reviewers: arudolph

CC:

Differential Revision: 72
This commit is contained in:
epriestley 2011-03-14 15:03:50 -07:00
parent eb58ed1b8b
commit 9b6e8aa6e1

View file

@ -139,6 +139,16 @@ EOTEXT
throw new ArcanistUsageException(
"You must specify one or more files to lint when using '--lintall'.");
}
foreach ($paths as $key => $path) {
$full_path = Filesystem::resolvePath($path);
if (!Filesystem::pathExists($full_path)) {
throw new ArcanistUsageException("Path '{$path}' does not exist!");
}
$relative_path = Filesystem::readablePath(
$full_path,
$working_copy->getProjectRoot());
$paths[$key] = $relative_path;
}
}
if (!$engine) {