Page MenuHomePhabricator

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

Authored by joshuaspence on May 17 2014, 4:47 AM.
Tags
None
Referenced Files
F13212957: D9159.diff
Fri, May 17, 7:13 AM
Unknown Object (File)
Tue, May 7, 5:34 AM
Unknown Object (File)
Fri, May 3, 3:37 AM
Unknown Object (File)
Tue, Apr 30, 12:08 AM
Unknown Object (File)
Mon, Apr 29, 2:47 PM
Unknown Object (File)
Wed, Apr 24, 10:15 PM
Unknown Object (File)
Fri, Apr 19, 3:29 PM
Unknown Object (File)
Apr 5 2024, 5:12 PM
Subscribers

Details

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.

Diff Detail

Repository
rARC Arcanist
Branch
lint-cwd
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 522
Build 522: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

joshuaspence retitled this revision from to Set the working directory to the project root for external linter `ExecFuture` classes..
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.
This revision is now accepted and ready to land.May 17 2014, 4:48 AM
epriestley updated this revision to Diff 21763.

Closed by commit rARC7bde5941cf71 (authored by @joshuaspence, committed by @epriestley).

My only concern with this method is that it makes the output of arc lint --trace harder to read, because it is not clear that the command is being executed in the project root,

It would occasionally be nice to have CWD and ENV in --trace somehow, but they'd be really spammy 99% of the time.