1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +01:00

Set the working directory to the project root for external linter ExecFuture classes.

Summary: Fixes T5085. Currently, the `ExecFuture` instances that are used to call an external linter are executed in the current working directory. This means that if a path is specified in the `.arclint` file, relative to the project root directory, that the path will not be properly interpreted by the external linter when `arc lint` is called from a level deeper than the project root.

Test Plan: Ran `arc lint` from a subdirectory of a project and verified that the linter did not throw an exception due to not being able to find the specified configuration file.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5085

Differential Revision: https://secure.phabricator.com/D9159
This commit is contained in:
Joshua Spence 2014-05-16 21:48:12 -07:00 committed by epriestley
parent 8cd9cb1047
commit 7bde5941cf

View file

@ -414,6 +414,7 @@ abstract class ArcanistExternalLinter extends ArcanistFutureLinter {
$future = new ExecFuture('%C %C', $bin, $path_argument);
}
$future->setCWD($this->getEngine()->getWorkingCopy()->getProjectRoot());
$futures[$path] = $future;
}