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
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) {