Page MenuHomePhabricator

Add ability to use csharp linter from everywhere
Needs RevisionPublic

Authored by patrick-alt on Dec 16 2014, 4:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 7, 10:30 AM
Unknown Object (File)
Feb 2 2024, 4:45 PM
Unknown Object (File)
Oct 31 2023, 11:06 PM
Unknown Object (File)
Jul 23 2023, 7:58 PM
Unknown Object (File)
May 11 2023, 6:15 AM
Unknown Object (File)
Apr 14 2023, 9:56 AM
Unknown Object (File)
Jan 4 2023, 2:52 PM
Unknown Object (File)
Sep 21 2022, 9:15 AM

Details

Summary

arc lint and other workflows using the csharp linter can now be executed from everywhere in the project tree.

Test Plan

Execute arc lint from arbitrary folders in the project tree of a csharp project. It should create all file paths correctly now by using the project root as the base path.

Diff Detail

Repository
rARC Arcanist
Branch
master
Lint
Lint Passed
Unit
Test Failures
Build Status
Buildable 3268
Build 3274: [Placeholder Plan] Wait for 30 Seconds

Unit TestsFailed

TimeTest
0 mstestPHPLint
0 mstestFixLetterCase
0 mstestJSONLinter
0 mstestMergeConflictLint
0 mstestPHPCSLint
View Full Test Results (1 Failed · 9 Passed · 17 Skipped)

Event Timeline

patrick-alt retitled this revision from to Add ability to use csharp linter from everywhere.
patrick-alt updated this object.
patrick-alt edited the test plan for this revision. (Show Details)
patrick-alt added a reviewer: epriestley.
joshuaspence added a reviewer: joshuaspence.

The proper fix here is to convert ArcanistCSharpLinter to extend from ArcanistExternalLinter. Once this is done, the future will always be resolved relative to the project root directory:

if ($this->supportsReadDataFromStdin()) {
  $future = new ExecFuture(
    '%C %C',
    $bin,
    $this->getReadDataFromStdinFilename());
  $future->write($this->getEngine()->loadData($path));
} else {
  // TODO: In commit hook mode, we need to do more handling here.
  $disk_path = $this->getEngine()->getFilePathOnDisk($path);
  $path_argument = $this->getPathArgumentForLinterFuture($disk_path);
  $future = new ExecFuture('%C %C', $bin, $path_argument);
}

$future->setCWD($this->getEngine()->getWorkingCopy()->getProjectRoot());
$futures[$path] = $future;
This revision now requires changes to proceed.Mar 1 2015, 9:22 PM