mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 06:42:41 +01:00
Remove @group
annotations
Summary: I'm pretty sure that `@group` annotations are useless now... I believe that they were originally used by Diviner? Test Plan: Eye-balled it. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin, aurelijus Differential Revision: https://secure.phabricator.com/D9855
This commit is contained in:
parent
b09d21d878
commit
d09beeb75c
123 changed files with 347 additions and 575 deletions
|
@ -11,7 +11,6 @@
|
||||||
* When looking in these places, we expect to find a 'libphutil/' directory.
|
* When looking in these places, we expect to find a 'libphutil/' directory.
|
||||||
*/
|
*/
|
||||||
function arcanist_adjust_php_include_path() {
|
function arcanist_adjust_php_include_path() {
|
||||||
|
|
||||||
// The 'arcanist/' directory.
|
// The 'arcanist/' directory.
|
||||||
$arcanist_dir = dirname(dirname(__FILE__));
|
$arcanist_dir = dirname(dirname(__FILE__));
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
* - add new flags to existing workflows by overriding
|
* - add new flags to existing workflows by overriding
|
||||||
* getCustomArgumentsForCommand().
|
* getCustomArgumentsForCommand().
|
||||||
*
|
*
|
||||||
* @group config
|
|
||||||
* @concrete-extensible
|
* @concrete-extensible
|
||||||
*/
|
*/
|
||||||
class ArcanistConfiguration {
|
class ArcanistConfiguration {
|
||||||
|
@ -65,8 +64,11 @@ class ArcanistConfiguration {
|
||||||
// This is a hook.
|
// This is a hook.
|
||||||
}
|
}
|
||||||
|
|
||||||
public function didRunWorkflow($command, ArcanistBaseWorkflow $workflow,
|
public function didRunWorkflow(
|
||||||
|
$command,
|
||||||
|
ArcanistBaseWorkflow $workflow,
|
||||||
$err) {
|
$err) {
|
||||||
|
|
||||||
// This is a hook.
|
// This is a hook.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class holds everything related to configuration and configuration files.
|
* This class holds everything related to configuration and configuration files.
|
||||||
*
|
|
||||||
* @group config
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistConfigurationManager {
|
final class ArcanistConfigurationManager {
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
* @group config
|
|
||||||
*/
|
|
||||||
final class ArcanistSettings {
|
final class ArcanistSettings {
|
||||||
|
|
||||||
private function getOptions() {
|
private function getOptions() {
|
||||||
|
@ -329,5 +326,4 @@ final class ArcanistSettings {
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,6 @@ final class ArcanistBritishTestCase extends ArcanistTestCase {
|
||||||
"Correction of {$input} against: {$commands}");
|
"Correction of {$input} against: {$commands}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testArgumentCompletion() {
|
public function testArgumentCompletion() {
|
||||||
$this->assertArgumentCompletion(
|
$this->assertArgumentCompletion(
|
||||||
array('nolint'),
|
array('nolint'),
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dumping ground for diff- and diff-algorithm-related miscellany.
|
* Dumping ground for diff- and diff-algorithm-related miscellany.
|
||||||
*
|
|
||||||
* @group diff
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistDiffUtils {
|
final class ArcanistDiffUtils {
|
||||||
|
|
||||||
|
|
|
@ -2,71 +2,70 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test cases for @{class:ArcanistDiffUtils}.
|
* Test cases for @{class:ArcanistDiffUtils}.
|
||||||
*
|
|
||||||
* @group testcase
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistDiffUtilsTestCase extends ArcanistTestCase {
|
final class ArcanistDiffUtilsTestCase extends ArcanistTestCase {
|
||||||
|
|
||||||
public function testLevenshtein() {
|
public function testLevenshtein() {
|
||||||
$tests = array(
|
$tests = array(
|
||||||
array(
|
array(
|
||||||
'a',
|
'a',
|
||||||
'b',
|
'b',
|
||||||
'x'
|
'x',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'kalrmr(array($b))',
|
'kalrmr(array($b))',
|
||||||
'array($b)',
|
'array($b)',
|
||||||
'dddddddssssssssds'
|
'dddddddssssssssds',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'array($b)',
|
'array($b)',
|
||||||
'kalrmr(array($b))',
|
'kalrmr(array($b))',
|
||||||
'iiiiiiissssssssis'
|
'iiiiiiissssssssis',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'zkalrmr(array($b))z',
|
'zkalrmr(array($b))z',
|
||||||
'xarray($b)x',
|
'xarray($b)x',
|
||||||
'dddddddxsssssssssdx'
|
'dddddddxsssssssssdx',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'xarray($b)x',
|
'xarray($b)x',
|
||||||
'zkalrmr(array($b))z',
|
'zkalrmr(array($b))z',
|
||||||
'iiiiiiixsssssssssix'
|
'iiiiiiixsssssssssix',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'abcdefghi',
|
'abcdefghi',
|
||||||
'abcdefghi',
|
'abcdefghi',
|
||||||
'sssssssss'
|
'sssssssss',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'abcdefghi',
|
'abcdefghi',
|
||||||
'abcdefghijkl',
|
'abcdefghijkl',
|
||||||
'sssssssssiii'
|
'sssssssssiii',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'abcdefghijkl',
|
'abcdefghijkl',
|
||||||
'abcdefghi',
|
'abcdefghi',
|
||||||
'sssssssssddd'
|
'sssssssssddd',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'xyzabcdefghi',
|
'xyzabcdefghi',
|
||||||
'abcdefghi',
|
'abcdefghi',
|
||||||
'dddsssssssss'
|
'dddsssssssss',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'abcdefghi',
|
'abcdefghi',
|
||||||
'xyzabcdefghi',
|
'xyzabcdefghi',
|
||||||
'iiisssssssss'
|
'iiisssssssss',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'abcdefg',
|
'abcdefg',
|
||||||
'abxdxfg',
|
'abxdxfg',
|
||||||
'ssxsxss'
|
'ssxsxss',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'private function a($a, $b) {',
|
'private function a($a, $b) {',
|
||||||
'public function and($b, $c) {',
|
'public function and($b, $c) {',
|
||||||
'siixsdddxsssssssssssiissxsssxsss'
|
'siixsdddxsssssssssssiissxsssxsss',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
|
|
||||||
|
@ -122,7 +121,7 @@ final class ArcanistDiffUtilsTestCase extends ArcanistTestCase {
|
||||||
$right = '';
|
$right = '';
|
||||||
$result = array(
|
$result = array(
|
||||||
array(array(0, 0)),
|
array(array(0, 0)),
|
||||||
array(array(0, 0))
|
array(array(0, 0)),
|
||||||
);
|
);
|
||||||
$this->assertEqual(
|
$this->assertEqual(
|
||||||
$result,
|
$result,
|
||||||
|
@ -133,7 +132,7 @@ final class ArcanistDiffUtilsTestCase extends ArcanistTestCase {
|
||||||
$right = "Grumpy\xE2\x98\x83at";
|
$right = "Grumpy\xE2\x98\x83at";
|
||||||
$result = array(
|
$result = array(
|
||||||
array(array(0, 0)),
|
array(array(0, 0)),
|
||||||
array(array(0, 11))
|
array(array(0, 11)),
|
||||||
);
|
);
|
||||||
$this->assertEqual(
|
$this->assertEqual(
|
||||||
$result,
|
$result,
|
||||||
|
@ -144,7 +143,7 @@ final class ArcanistDiffUtilsTestCase extends ArcanistTestCase {
|
||||||
$right = '';
|
$right = '';
|
||||||
$result = array(
|
$result = array(
|
||||||
array(array(0, 11)),
|
array(array(0, 11)),
|
||||||
array(array(0, 0))
|
array(array(0, 0)),
|
||||||
);
|
);
|
||||||
$this->assertEqual(
|
$this->assertEqual(
|
||||||
$result,
|
$result,
|
||||||
|
@ -155,7 +154,7 @@ final class ArcanistDiffUtilsTestCase extends ArcanistTestCase {
|
||||||
$right = "Grumpy\xE2\x98\x83at";
|
$right = "Grumpy\xE2\x98\x83at";
|
||||||
$result = array(
|
$result = array(
|
||||||
array(array(0, 11)),
|
array(array(0, 11)),
|
||||||
array(array(0, 11))
|
array(array(0, 11)),
|
||||||
);
|
);
|
||||||
$this->assertEqual(
|
$this->assertEqual(
|
||||||
$result,
|
$result,
|
||||||
|
@ -166,7 +165,7 @@ final class ArcanistDiffUtilsTestCase extends ArcanistTestCase {
|
||||||
$right = 'Smiling Dog';
|
$right = 'Smiling Dog';
|
||||||
$result = array(
|
$result = array(
|
||||||
array(array(1, 11)),
|
array(array(1, 11)),
|
||||||
array(array(1, 11))
|
array(array(1, 11)),
|
||||||
);
|
);
|
||||||
$this->assertEqual(
|
$this->assertEqual(
|
||||||
$result,
|
$result,
|
||||||
|
@ -177,7 +176,7 @@ final class ArcanistDiffUtilsTestCase extends ArcanistTestCase {
|
||||||
$right = "Grumpy\xE2\x98\x83at";
|
$right = "Grumpy\xE2\x98\x83at";
|
||||||
$result = array(
|
$result = array(
|
||||||
array(array(0, 6), array(1, 1), array(0, 2)),
|
array(array(0, 6), array(1, 1), array(0, 2)),
|
||||||
array(array(0, 6), array(1, 3), array(0, 2))
|
array(array(0, 6), array(1, 3), array(0, 2)),
|
||||||
);
|
);
|
||||||
$this->assertEqual(
|
$this->assertEqual(
|
||||||
$result,
|
$result,
|
||||||
|
@ -188,7 +187,7 @@ final class ArcanistDiffUtilsTestCase extends ArcanistTestCase {
|
||||||
$right = "Grumpy\xE2\x98\x83a\xE2\x98\x83t";
|
$right = "Grumpy\xE2\x98\x83a\xE2\x98\x83t";
|
||||||
$result = array(
|
$result = array(
|
||||||
array(array(0, 6), array(1, 2), array(0, 1)),
|
array(array(0, 6), array(1, 2), array(0, 1)),
|
||||||
array(array(0, 6), array(1, 7), array(0, 1))
|
array(array(0, 6), array(1, 7), array(0, 1)),
|
||||||
);
|
);
|
||||||
$this->assertEqual(
|
$this->assertEqual(
|
||||||
$result,
|
$result,
|
||||||
|
@ -199,7 +198,7 @@ final class ArcanistDiffUtilsTestCase extends ArcanistTestCase {
|
||||||
$right = "DrumpyC\xE2\x98\x83t";
|
$right = "DrumpyC\xE2\x98\x83t";
|
||||||
$result = array(
|
$result = array(
|
||||||
array(array(1, 1), array(0, 10)),
|
array(array(1, 1), array(0, 10)),
|
||||||
array(array(1, 1), array(0, 10))
|
array(array(1, 1), array(0, 10)),
|
||||||
);
|
);
|
||||||
$this->assertEqual(
|
$this->assertEqual(
|
||||||
$result,
|
$result,
|
||||||
|
@ -210,7 +209,7 @@ final class ArcanistDiffUtilsTestCase extends ArcanistTestCase {
|
||||||
$right = "GrumpyC\xE2\x98\x83P";
|
$right = "GrumpyC\xE2\x98\x83P";
|
||||||
$result = array(
|
$result = array(
|
||||||
array(array(0, 10), array(1, 1)),
|
array(array(0, 10), array(1, 1)),
|
||||||
array(array(0, 10), array(1, 1))
|
array(array(0, 10), array(1, 1)),
|
||||||
);
|
);
|
||||||
$this->assertEqual(
|
$this->assertEqual(
|
||||||
$result,
|
$result,
|
||||||
|
@ -221,7 +220,7 @@ final class ArcanistDiffUtilsTestCase extends ArcanistTestCase {
|
||||||
$right = "DrumpyC\xE2\x98\x83P";
|
$right = "DrumpyC\xE2\x98\x83P";
|
||||||
$result = array(
|
$result = array(
|
||||||
array(array(1, 1), array(0, 9), array(1, 1)),
|
array(array(1, 1), array(0, 9), array(1, 1)),
|
||||||
array(array(1, 1), array(0, 9), array(1, 1))
|
array(array(1, 1), array(0, 9), array(1, 1)),
|
||||||
);
|
);
|
||||||
$this->assertEqual(
|
$this->assertEqual(
|
||||||
$result,
|
$result,
|
||||||
|
@ -233,10 +232,11 @@ final class ArcanistDiffUtilsTestCase extends ArcanistTestCase {
|
||||||
$right = "Sen{$cc}or";
|
$right = "Sen{$cc}or";
|
||||||
$result = array(
|
$result = array(
|
||||||
array(array(0, 2), array(1, 1), array(0, 2)),
|
array(array(0, 2), array(1, 1), array(0, 2)),
|
||||||
array(array(0, 2), array(1, 3), array(0, 2))
|
array(array(0, 2), array(1, 3), array(0, 2)),
|
||||||
);
|
);
|
||||||
$this->assertEqual(
|
$this->assertEqual(
|
||||||
$result,
|
$result,
|
||||||
ArcanistDiffUtils::generateIntralineDiff($left, $right));
|
ArcanistDiffUtils::generateIntralineDiff($left, $right));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a parsed commit message.
|
* Represents a parsed commit message.
|
||||||
*
|
|
||||||
* @group differential
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistDifferentialCommitMessage {
|
final class ArcanistDifferentialCommitMessage {
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thrown when a commit message isn't parseable.
|
* Thrown when a commit message isn't parseable.
|
||||||
*
|
|
||||||
* @group differential
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistDifferentialCommitMessageParserException extends Exception {
|
final class ArcanistDifferentialCommitMessageParserException extends Exception {
|
||||||
|
|
||||||
|
|
|
@ -12,4 +12,5 @@ final class ArcanistEventType extends PhutilEventType {
|
||||||
const TYPE_REVISION_WILLCREATEREVISION = 'revision.willCreateRevision';
|
const TYPE_REVISION_WILLCREATEREVISION = 'revision.willCreateRevision';
|
||||||
|
|
||||||
const TYPE_LAND_WILLPUSHREVISION = 'land.willPushRevision';
|
const TYPE_LAND_WILLPUSHREVISION = 'land.willPushRevision';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,5 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thrown when the user chooses an invalid revision when prompted by a workflow.
|
* Thrown when the user chooses an invalid revision when prompted by a workflow.
|
||||||
*
|
|
||||||
* @group workflow
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistChooseInvalidRevisionException extends Exception {
|
final class ArcanistChooseInvalidRevisionException extends Exception {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -3,9 +3,5 @@
|
||||||
/**
|
/**
|
||||||
* Thrown when there are no valid revisions to choose from, in a workflow which
|
* Thrown when there are no valid revisions to choose from, in a workflow which
|
||||||
* prompts the user to choose a revision.
|
* prompts the user to choose a revision.
|
||||||
*
|
|
||||||
* @group workflow
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistChooseNoRevisionsException extends Exception {
|
final class ArcanistChooseNoRevisionsException extends Exception {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -4,9 +4,6 @@
|
||||||
* Thrown when there is a problem with how a user is invoking a command, rather
|
* Thrown when there is a problem with how a user is invoking a command, rather
|
||||||
* than a technical problem.
|
* than a technical problem.
|
||||||
*
|
*
|
||||||
* @group workflow
|
|
||||||
* @concrete-extensible
|
* @concrete-extensible
|
||||||
*/
|
*/
|
||||||
class ArcanistUsageException extends Exception {
|
class ArcanistUsageException extends Exception {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -3,8 +3,5 @@
|
||||||
/**
|
/**
|
||||||
* Thrown when lint or unit tests have no effect, i.e. no paths are affected
|
* Thrown when lint or unit tests have no effect, i.e. no paths are affected
|
||||||
* by any linter or no unit tests provide coverage.
|
* by any linter or no unit tests provide coverage.
|
||||||
*
|
|
||||||
* @group workflow
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistNoEffectException extends ArcanistUsageException {
|
final class ArcanistNoEffectException extends ArcanistUsageException {}
|
||||||
}
|
|
||||||
|
|
|
@ -2,8 +2,5 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thrown when no engine is configured for linting or running unit tests.
|
* Thrown when no engine is configured for linting or running unit tests.
|
||||||
*
|
|
||||||
* @group workflow
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistNoEngineException extends ArcanistUsageException {
|
final class ArcanistNoEngineException extends ArcanistUsageException {}
|
||||||
}
|
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
/**
|
/**
|
||||||
* Thrown when the user chooses not to continue when warned that they're about
|
* Thrown when the user chooses not to continue when warned that they're about
|
||||||
* to do something dangerous.
|
* to do something dangerous.
|
||||||
*
|
|
||||||
* @group workflow
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistUserAbortException extends ArcanistUsageException {
|
final class ArcanistUserAbortException extends ArcanistUsageException {
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
parent::__construct('User aborted the workflow.');
|
parent::__construct('User aborted the workflow.');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Client for an @{class:ArcanistHgProxyServer}. This client talks to a PHP
|
* Client for an @{class:ArcanistHgProxyServer}. This client talks to a PHP
|
||||||
* process which serves as a proxy in front of a Mercurial server process.
|
* process which serves as a proxy in front of a Mercurial server process.
|
||||||
|
|
|
@ -446,7 +446,6 @@ final class ArcanistHgProxyServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private function daemonize() {
|
private function daemonize() {
|
||||||
|
|
||||||
// Keep stdout if it's been redirected somewhere, otherwise shut it down.
|
// Keep stdout if it's been redirected somewhere, otherwise shut it down.
|
||||||
$keep_stdout = false;
|
$keep_stdout = false;
|
||||||
$keep_stderr = false;
|
$keep_stderr = false;
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Message emitted by a linter, like an error or warning.
|
* Message emitted by a linter, like an error or warning.
|
||||||
*
|
|
||||||
* @group lint
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistLintMessage {
|
final class ArcanistLintMessage {
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies lint patches to the working copy.
|
* Applies lint patches to the working copy.
|
||||||
*
|
|
||||||
* @group lint
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistLintPatcher {
|
final class ArcanistLintPatcher {
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A group of @{class:ArcanistLintMessage}s that apply to a file.
|
* A group of @{class:ArcanistLintMessage}s that apply to a file.
|
||||||
*
|
|
||||||
* @group lint
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistLintResult {
|
final class ArcanistLintResult {
|
||||||
|
|
||||||
|
@ -101,7 +99,6 @@ final class ArcanistLintResult {
|
||||||
|
|
||||||
$this->effectiveMessages = $messages;
|
$this->effectiveMessages = $messages;
|
||||||
$this->needsSort = false;
|
$this->needsSort = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes the severity of an @{class:ArcanistLintMessage}.
|
* Describes the severity of an @{class:ArcanistLintMessage}.
|
||||||
*
|
|
||||||
* @group lint
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistLintSeverity {
|
final class ArcanistLintSeverity {
|
||||||
|
|
||||||
|
@ -34,7 +32,6 @@ final class ArcanistLintSeverity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function isAtLeastAsSevere($message_sev, $level) {
|
public static function isAtLeastAsSevere($message_sev, $level) {
|
||||||
|
|
||||||
static $map = array(
|
static $map = array(
|
||||||
self::SEVERITY_DISABLED => 10,
|
self::SEVERITY_DISABLED => 10,
|
||||||
self::SEVERITY_ADVICE => 20,
|
self::SEVERITY_ADVICE => 20,
|
||||||
|
@ -50,5 +47,4 @@ final class ArcanistLintSeverity {
|
||||||
return $map[$message_sev] >= idx($map, $level, 0);
|
return $map[$message_sev] >= idx($map, $level, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
* See @{article@phabricator:Arcanist User Guide: Customizing Lint, Unit Tests
|
* See @{article@phabricator:Arcanist User Guide: Customizing Lint, Unit Tests
|
||||||
* and Workflows} for more information about configuring lint engines.
|
* and Workflows} for more information about configuring lint engines.
|
||||||
*
|
*
|
||||||
* @group lint
|
|
||||||
* @stable
|
* @stable
|
||||||
*/
|
*/
|
||||||
abstract class ArcanistLintEngine {
|
abstract class ArcanistLintEngine {
|
||||||
|
@ -385,8 +384,10 @@ abstract class ArcanistLintEngine {
|
||||||
return ArcanistLintSeverity::isAtLeastAsSevere($severity, $minimum);
|
return ArcanistLintSeverity::isAtLeastAsSevere($severity, $minimum);
|
||||||
}
|
}
|
||||||
|
|
||||||
final private function shouldUseCache($cache_granularity,
|
final private function shouldUseCache(
|
||||||
|
$cache_granularity,
|
||||||
$repository_version) {
|
$repository_version) {
|
||||||
|
|
||||||
if ($this->commitHookMode) {
|
if ($this->commitHookMode) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -580,5 +581,4 @@ abstract class ArcanistLintEngine {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
*
|
*
|
||||||
* Set which linter should be run by configuring `lint.engine.single.linter` in
|
* Set which linter should be run by configuring `lint.engine.single.linter` in
|
||||||
* `.arcconfig` or user config.
|
* `.arcconfig` or user config.
|
||||||
*
|
|
||||||
* @group linter
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistSingleLintEngine extends ArcanistLintEngine {
|
final class ArcanistSingleLintEngine extends ArcanistLintEngine {
|
||||||
|
|
||||||
|
@ -60,4 +58,5 @@ final class ArcanistSingleLintEngine extends ArcanistLintEngine {
|
||||||
|
|
||||||
return array($linter);
|
return array($linter);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Basic lint engine which just applies several linters based on the file types
|
* Basic lint engine which just applies several linters based on the file types.
|
||||||
*
|
|
||||||
* @group linter
|
|
||||||
*/
|
*/
|
||||||
final class ComprehensiveLintEngine extends ArcanistLintEngine {
|
final class ComprehensiveLintEngine extends ArcanistLintEngine {
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
/**
|
/**
|
||||||
* Lint engine for use in constructing test cases. See
|
* Lint engine for use in constructing test cases. See
|
||||||
* @{class:ArcanistLinterTestCase}.
|
* @{class:ArcanistLinterTestCase}.
|
||||||
*
|
|
||||||
* @group testcase
|
|
||||||
*/
|
*/
|
||||||
final class UnitTestableArcanistLintEngine extends ArcanistLintEngine {
|
final class UnitTestableArcanistLintEngine extends ArcanistLintEngine {
|
||||||
|
|
||||||
|
|
|
@ -85,18 +85,17 @@ final class ArcanistConduitLinter extends ArcanistLinter {
|
||||||
// customization directly.
|
// customization directly.
|
||||||
throw new ArcanistUsageException(
|
throw new ArcanistUsageException(
|
||||||
'ArcanistConduitLinter does not support client-side severity '.
|
'ArcanistConduitLinter does not support client-side severity '.
|
||||||
'customization.'
|
'customization.');
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLintNameMap() {
|
public function getLintNameMap() {
|
||||||
// See getLintSeverityMap for rationale.
|
// See getLintSeverityMap for rationale.
|
||||||
throw new ArcanistUsageException(
|
throw new ArcanistUsageException(
|
||||||
'ArcanistConduitLinter does not support a name map.'
|
'ArcanistConduitLinter does not support a name map.');
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function canCustomizeLintSeverities() {
|
protected function canCustomizeLintSeverities() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,4 +93,5 @@ final class ArcanistJSONLintLinter extends ArcanistExternalLinter {
|
||||||
|
|
||||||
return $messages;
|
return $messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
* Implements lint rules, like syntax checks for a specific language.
|
* Implements lint rules, like syntax checks for a specific language.
|
||||||
*
|
*
|
||||||
* @task info Human Readable Information
|
* @task info Human Readable Information
|
||||||
*
|
|
||||||
* @stable
|
* @stable
|
||||||
*/
|
*/
|
||||||
abstract class ArcanistLinter {
|
abstract class ArcanistLinter {
|
||||||
|
|
|
@ -50,4 +50,5 @@ final class ArcanistMergeConflictLinter extends ArcanistLinter {
|
||||||
self::LINT_MERGECONFLICT => pht('Unresolved merge conflict'),
|
self::LINT_MERGECONFLICT => pht('Unresolved merge conflict'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uses "PHP_CodeSniffer" to detect checkstyle errors in PHP code.
|
* Uses "PHP_CodeSniffer" to detect checkstyle errors in PHP code.
|
||||||
*
|
|
||||||
* @group linter
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistPhpcsLinter extends ArcanistExternalLinter {
|
final class ArcanistPhpcsLinter extends ArcanistExternalLinter {
|
||||||
|
|
||||||
|
|
|
@ -103,4 +103,5 @@ final class ArcanistPuppetLintLinter extends ArcanistExternalLinter {
|
||||||
|
|
||||||
return $messages;
|
return $messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,20 +48,18 @@
|
||||||
* (E) error, for probable bugs in the code
|
* (E) error, for probable bugs in the code
|
||||||
* (F) fatal, if an error occurred which prevented pylint from
|
* (F) fatal, if an error occurred which prevented pylint from
|
||||||
* doing further processing.
|
* doing further processing.
|
||||||
*
|
|
||||||
* @group linter
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistPyLintLinter extends ArcanistLinter {
|
final class ArcanistPyLintLinter extends ArcanistLinter {
|
||||||
|
|
||||||
private function getMessageCodeSeverity($code) {
|
private function getMessageCodeSeverity($code) {
|
||||||
$config = $this->getEngine()->getConfigurationManager();
|
$config = $this->getEngine()->getConfigurationManager();
|
||||||
|
|
||||||
$error_regexp =
|
$error_regexp = $config->getConfigFromAnySource(
|
||||||
$config->getConfigFromAnySource('lint.pylint.codes.error');
|
'lint.pylint.codes.error');
|
||||||
$warning_regexp =
|
$warning_regexp = $config->getConfigFromAnySource(
|
||||||
$config->getConfigFromAnySource('lint.pylint.codes.warning');
|
'lint.pylint.codes.warning');
|
||||||
$advice_regexp =
|
$advice_regexp = $config->getConfigFromAnySource(
|
||||||
$config->getConfigFromAnySource('lint.pylint.codes.advice');
|
'lint.pylint.codes.advice');
|
||||||
|
|
||||||
if (!$error_regexp && !$warning_regexp && !$advice_regexp) {
|
if (!$error_regexp && !$warning_regexp && !$advice_regexp) {
|
||||||
throw new ArcanistUsageException(
|
throw new ArcanistUsageException(
|
||||||
|
|
|
@ -152,8 +152,6 @@
|
||||||
* @task linterinfo Linter Information
|
* @task linterinfo Linter Information
|
||||||
* @task parse Parsing Output
|
* @task parse Parsing Output
|
||||||
* @task config Validating Configuration
|
* @task config Validating Configuration
|
||||||
*
|
|
||||||
* @group linter
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistScriptAndRegexLinter extends ArcanistLinter {
|
final class ArcanistScriptAndRegexLinter extends ArcanistLinter {
|
||||||
|
|
||||||
|
|
|
@ -195,4 +195,5 @@ abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
|
||||||
$actual,
|
$actual,
|
||||||
'File as patched by lint did not match the expected patched file.');
|
'File as patched by lint did not match the expected patched file.');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
* @task override Overriding Symbol Name Lint Messages
|
* @task override Overriding Symbol Name Lint Messages
|
||||||
* @task util Name Utilities
|
* @task util Name Utilities
|
||||||
* @task internal Internals
|
* @task internal Internals
|
||||||
* @group lint
|
|
||||||
* @stable
|
* @stable
|
||||||
*/
|
*/
|
||||||
abstract class ArcanistXHPASTLintNamingHook {
|
abstract class ArcanistXHPASTLintNamingHook {
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
/**
|
/**
|
||||||
* You can extend this class and set `xhpast.switchhook` in your `.arclint`
|
* You can extend this class and set `xhpast.switchhook` in your `.arclint`
|
||||||
* to have an opportunity to override results for linting `switch` statements.
|
* to have an opportunity to override results for linting `switch` statements.
|
||||||
*
|
|
||||||
* @group lint
|
|
||||||
*/
|
*/
|
||||||
abstract class ArcanistXHPASTLintSwitchHook {
|
abstract class ArcanistXHPASTLintSwitchHook {
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test cases for @{class:ArcanistXHPASTLintNamingHook}.
|
* Test cases for @{class:ArcanistXHPASTLintNamingHook}.
|
||||||
*
|
|
||||||
* @group testcase
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistXHPASTLintNamingHookTestCase extends ArcanistTestCase {
|
final class ArcanistXHPASTLintNamingHookTestCase extends ArcanistTestCase {
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows lint messages to the user.
|
* Shows lint messages to the user.
|
||||||
*
|
|
||||||
* @group lint
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistLintCheckstyleXMLRenderer extends ArcanistLintRenderer {
|
final class ArcanistLintCheckstyleXMLRenderer extends ArcanistLintRenderer {
|
||||||
|
|
||||||
|
@ -53,4 +51,5 @@ final class ArcanistLintCheckstyleXMLRenderer extends ArcanistLintRenderer {
|
||||||
$this->writer->endDocument();
|
$this->writer->endDocument();
|
||||||
return $this->writer->flush();
|
return $this->writer->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows lint messages to the user.
|
* Shows lint messages to the user.
|
||||||
*
|
|
||||||
* @group lint
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistLintConsoleRenderer extends ArcanistLintRenderer {
|
final class ArcanistLintConsoleRenderer extends ArcanistLintRenderer {
|
||||||
|
|
||||||
private $showAutofixPatches = false;
|
private $showAutofixPatches = false;
|
||||||
|
|
||||||
public function setShowAutofixPatches($show_autofix_patches) {
|
public function setShowAutofixPatches($show_autofix_patches) {
|
||||||
|
@ -234,7 +233,8 @@ final class ArcanistLintConsoleRenderer extends ArcanistLintRenderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderOkayResult() {
|
public function renderOkayResult() {
|
||||||
return
|
return phutil_console_format(
|
||||||
phutil_console_format("<bg:green>** OKAY **</bg> No lint warnings.\n");
|
"<bg:green>** OKAY **</bg> No lint warnings.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows lint messages to the user.
|
* Shows lint messages to the user.
|
||||||
*
|
|
||||||
* @group lint
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistLintJSONRenderer extends ArcanistLintRenderer {
|
final class ArcanistLintJSONRenderer extends ArcanistLintRenderer {
|
||||||
|
|
||||||
const LINES_OF_CONTEXT = 3;
|
const LINES_OF_CONTEXT = 3;
|
||||||
|
|
||||||
public function renderLintResult(ArcanistLintResult $result) {
|
public function renderLintResult(ArcanistLintResult $result) {
|
||||||
|
@ -32,4 +31,5 @@ final class ArcanistLintJSONRenderer extends ArcanistLintRenderer {
|
||||||
public function renderOkayResult() {
|
public function renderOkayResult() {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows lint messages to the user.
|
* Shows lint messages to the user.
|
||||||
*
|
|
||||||
* @group lint
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistLintLikeCompilerRenderer extends ArcanistLintRenderer {
|
final class ArcanistLintLikeCompilerRenderer extends ArcanistLintRenderer {
|
||||||
|
|
||||||
public function renderLintResult(ArcanistLintResult $result) {
|
public function renderLintResult(ArcanistLintResult $result) {
|
||||||
$lines = array();
|
$lines = array();
|
||||||
$messages = $result->getMessages();
|
$messages = $result->getMessages();
|
||||||
|
@ -32,4 +31,5 @@ final class ArcanistLintLikeCompilerRenderer extends ArcanistLintRenderer {
|
||||||
public function renderOkayResult() {
|
public function renderOkayResult() {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
* @group lint
|
|
||||||
*/
|
|
||||||
final class ArcanistLintNoneRenderer extends ArcanistLintRenderer {
|
final class ArcanistLintNoneRenderer extends ArcanistLintRenderer {
|
||||||
|
|
||||||
public function renderLintResult(ArcanistLintResult $result) {
|
public function renderLintResult(ArcanistLintResult $result) {
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows lint messages to the user.
|
* Shows lint messages to the user.
|
||||||
*
|
|
||||||
* @group lint
|
|
||||||
*/
|
*/
|
||||||
abstract class ArcanistLintRenderer {
|
abstract class ArcanistLintRenderer {
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows lint messages to the user.
|
* Shows lint messages to the user.
|
||||||
*
|
|
||||||
* @group lint
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistLintSummaryRenderer extends ArcanistLintRenderer {
|
final class ArcanistLintSummaryRenderer extends ArcanistLintRenderer {
|
||||||
|
|
||||||
public function renderLintResult(ArcanistLintResult $result) {
|
public function renderLintResult(ArcanistLintResult $result) {
|
||||||
$messages = $result->getMessages();
|
$messages = $result->getMessages();
|
||||||
$path = $result->getPath();
|
$path = $result->getPath();
|
||||||
|
@ -24,7 +23,8 @@ final class ArcanistLintSummaryRenderer extends ArcanistLintRenderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderOkayResult() {
|
public function renderOkayResult() {
|
||||||
return
|
return phutil_console_format(
|
||||||
phutil_console_format("<bg:green>** OKAY **</bg> No lint warnings.\n");
|
"<bg:green>** OKAY **</bg> No lint warnings.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,6 @@ final class ArcanistBaseCommitParser {
|
||||||
* Handle resolving individual rules.
|
* Handle resolving individual rules.
|
||||||
*/
|
*/
|
||||||
private function resolveRule($rule, $source) {
|
private function resolveRule($rule, $source) {
|
||||||
|
|
||||||
// NOTE: Returning `null` from this method means "no match".
|
// NOTE: Returning `null` from this method means "no match".
|
||||||
// Returning `false` from this method means "stop current ruleset".
|
// Returning `false` from this method means "stop current ruleset".
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts changesets between different formats.
|
* Converts changesets between different formats.
|
||||||
*
|
|
||||||
* @group diff
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistBundle {
|
final class ArcanistBundle {
|
||||||
|
|
||||||
|
@ -108,7 +106,6 @@ final class ArcanistBundle {
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getEOL($patch_type) {
|
private function getEOL($patch_type) {
|
||||||
|
|
||||||
// NOTE: Git always generates "\n" line endings, even under Windows, and
|
// NOTE: Git always generates "\n" line endings, even under Windows, and
|
||||||
// can not parse certain patches with "\r\n" line endings. SVN generates
|
// can not parse certain patches with "\r\n" line endings. SVN generates
|
||||||
// patches with "\n" line endings on Mac or Linux and "\r\n" line endings
|
// patches with "\n" line endings on Mac or Linux and "\r\n" line endings
|
||||||
|
@ -198,9 +195,7 @@ final class ArcanistBundle {
|
||||||
return $obj;
|
return $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function __construct() {
|
private function __construct() {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function writeToDisk($path) {
|
public function writeToDisk($path) {
|
||||||
$changes = $this->getChanges();
|
$changes = $this->getChanges();
|
||||||
|
@ -260,7 +255,6 @@ final class ArcanistBundle {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function toUnifiedDiff() {
|
public function toUnifiedDiff() {
|
||||||
|
|
||||||
$eol = $this->getEOL('unified');
|
$eol = $this->getEOL('unified');
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses diffs from a working copy.
|
* Parses diffs from a working copy.
|
||||||
*
|
|
||||||
* @group diff
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistDiffParser {
|
final class ArcanistDiffParser {
|
||||||
|
|
||||||
|
@ -453,7 +451,6 @@ final class ArcanistDiffParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
private function parseSVNPropertyChange($op, $prop) {
|
private function parseSVNPropertyChange($op, $prop) {
|
||||||
|
|
||||||
$old = array();
|
$old = array();
|
||||||
$new = array();
|
$new = array();
|
||||||
|
|
||||||
|
@ -1378,7 +1375,6 @@ final class ArcanistDiffParser {
|
||||||
* Returns a parseable normal diff and a textual commit message.
|
* Returns a parseable normal diff and a textual commit message.
|
||||||
*/
|
*/
|
||||||
private function stripGitFormatPatch($diff) {
|
private function stripGitFormatPatch($diff) {
|
||||||
|
|
||||||
// We can parse this by splitting it into two pieces over and over again
|
// We can parse this by splitting it into two pieces over and over again
|
||||||
// along different section dividers:
|
// along different section dividers:
|
||||||
//
|
//
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test cases for @{class:ArcanistDiffParser}.
|
* Test cases for @{class:ArcanistDiffParser}.
|
||||||
*
|
|
||||||
* @group testcase
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistDiffParserTestCase extends ArcanistTestCase {
|
final class ArcanistDiffParserTestCase extends ArcanistTestCase {
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a change to an individual path.
|
* Represents a change to an individual path.
|
||||||
*
|
|
||||||
* @group diff
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistDiffChange {
|
final class ArcanistDiffChange {
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines constants for file types and operations in changesets.
|
* Defines constants for file types and operations in changesets.
|
||||||
*
|
|
||||||
* @group diff
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistDiffChangeType {
|
final class ArcanistDiffChangeType {
|
||||||
|
|
||||||
const TYPE_ADD = 1;
|
const TYPE_ADD = 1;
|
||||||
const TYPE_CHANGE = 2;
|
const TYPE_CHANGE = 2;
|
||||||
const TYPE_DELETE = 3;
|
const TYPE_DELETE = 3;
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a contiguous set of added and removed lines in a diff.
|
* Represents a contiguous set of added and removed lines in a diff.
|
||||||
*
|
|
||||||
* @group diff
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistDiffHunk {
|
final class ArcanistDiffHunk {
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interfaces with Git working copies.
|
* Interfaces with Git working copies.
|
||||||
*
|
|
||||||
* @group workingcopy
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistGitAPI extends ArcanistRepositoryAPI {
|
final class ArcanistGitAPI extends ArcanistRepositoryAPI {
|
||||||
|
|
||||||
|
@ -24,7 +22,6 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function buildLocalFuture(array $argv) {
|
protected function buildLocalFuture(array $argv) {
|
||||||
|
|
||||||
$argv[0] = 'git '.$argv[0];
|
$argv[0] = 'git '.$argv[0];
|
||||||
|
|
||||||
$future = newv('ExecFuture', $argv);
|
$future = newv('ExecFuture', $argv);
|
||||||
|
@ -547,8 +544,8 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
|
||||||
'svn find-rev %s',
|
'svn find-rev %s',
|
||||||
$input);
|
$input);
|
||||||
if (!$stdout) {
|
if (!$stdout) {
|
||||||
throw new ArcanistUsageException("Cannot find the {$vcs} equivalent "
|
throw new ArcanistUsageException(
|
||||||
."of {$input}.");
|
"Cannot find the {$vcs} equivalent of {$input}.");
|
||||||
}
|
}
|
||||||
// When git performs a partial-rebuild during svn
|
// When git performs a partial-rebuild during svn
|
||||||
// look-up, we need to parse the final line
|
// look-up, we need to parse the final line
|
||||||
|
@ -834,7 +831,6 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getFileDataAtRevision($path, $revision) {
|
private function getFileDataAtRevision($path, $revision) {
|
||||||
|
|
||||||
// NOTE: We don't want to just "git show {$revision}:{$path}" since if the
|
// NOTE: We don't want to just "git show {$revision}:{$path}" since if the
|
||||||
// path was a directory at the given revision we'll get a list of its files
|
// path was a directory at the given revision we'll get a list of its files
|
||||||
// and treat it as though it as a file containing a list of other files,
|
// and treat it as though it as a file containing a list of other files,
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interfaces with the Mercurial working copies.
|
* Interfaces with the Mercurial working copies.
|
||||||
*
|
|
||||||
* @group workingcopy
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
|
final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
|
||||||
|
|
||||||
|
@ -15,7 +13,6 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
|
||||||
private $supportsPhases;
|
private $supportsPhases;
|
||||||
|
|
||||||
protected function buildLocalFuture(array $argv) {
|
protected function buildLocalFuture(array $argv) {
|
||||||
|
|
||||||
// Mercurial has a "defaults" feature which basically breaks automation by
|
// Mercurial has a "defaults" feature which basically breaks automation by
|
||||||
// allowing the user to add random flags to any command. This feature is
|
// allowing the user to add random flags to any command. This feature is
|
||||||
// "deprecated" and "a bad idea" that you should "forget ... existed"
|
// "deprecated" and "a bad idea" that you should "forget ... existed"
|
||||||
|
@ -82,8 +79,8 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
|
||||||
'{node}',
|
'{node}',
|
||||||
$string);
|
$string);
|
||||||
if (!$stdout) {
|
if (!$stdout) {
|
||||||
throw new ArcanistUsageException("Cannot find the HG equivalent "
|
throw new ArcanistUsageException(
|
||||||
."of {$revision_id} given.");
|
"Cannot find the HG equivalent of {$revision_id} given.");
|
||||||
}
|
}
|
||||||
return $stdout;
|
return $stdout;
|
||||||
}
|
}
|
||||||
|
@ -94,8 +91,8 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
|
||||||
list($stdout) = $this->execxLocal(
|
list($stdout) = $this->execxLocal(
|
||||||
'log -r %s --template {svnrev}', $hash);
|
'log -r %s --template {svnrev}', $hash);
|
||||||
if (!$stdout) {
|
if (!$stdout) {
|
||||||
throw new ArcanistUsageException("Cannot find the SVN equivalent "
|
throw new ArcanistUsageException(
|
||||||
."of {$hash} given.");
|
"Cannot find the SVN equivalent of {$hash} given.");
|
||||||
}
|
}
|
||||||
return $stdout;
|
return $stdout;
|
||||||
}
|
}
|
||||||
|
@ -133,8 +130,9 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setBaseCommitExplanation('it is the greatest common ancestor of '.
|
$this->setBaseCommitExplanation(
|
||||||
'the working directory and the commit you specified explicitly.');
|
'it is the greatest common ancestor of the working directory '.
|
||||||
|
'and the commit you specified explicitly.');
|
||||||
return $commit;
|
return $commit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -731,10 +729,10 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse the Mercurial author field
|
* Parse the Mercurial author field.
|
||||||
*
|
*
|
||||||
* Not everyone enters their email address as a part of the username
|
* Not everyone enters their email address as a part of the username
|
||||||
* field. Try to make it work when it's obvious
|
* field. Try to make it work when it's obvious.
|
||||||
*
|
*
|
||||||
* @param string $full_author
|
* @param string $full_author
|
||||||
* @return array
|
* @return array
|
||||||
|
@ -762,9 +760,7 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
|
||||||
public function doCommit($message) {
|
public function doCommit($message) {
|
||||||
$tmp_file = new TempFile();
|
$tmp_file = new TempFile();
|
||||||
Filesystem::writeFile($tmp_file, $message);
|
Filesystem::writeFile($tmp_file, $message);
|
||||||
$this->execxLocal(
|
$this->execxLocal('commit -l %s', $tmp_file);
|
||||||
'commit -l %s',
|
|
||||||
$tmp_file);
|
|
||||||
$this->reloadWorkingCopy();
|
$this->reloadWorkingCopy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
* Interfaces with the VCS in the working copy.
|
* Interfaces with the VCS in the working copy.
|
||||||
*
|
*
|
||||||
* @task status Path Status
|
* @task status Path Status
|
||||||
* @group workingcopy
|
|
||||||
*/
|
*/
|
||||||
abstract class ArcanistRepositoryAPI {
|
abstract class ArcanistRepositoryAPI {
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interfaces with Subversion working copies.
|
* Interfaces with Subversion working copies.
|
||||||
*
|
|
||||||
* @group workingcopy
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistSubversionAPI extends ArcanistRepositoryAPI {
|
final class ArcanistSubversionAPI extends ArcanistRepositoryAPI {
|
||||||
|
|
||||||
|
@ -316,7 +314,6 @@ final class ArcanistSubversionAPI extends ArcanistRepositoryAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSVNInfo($path) {
|
public function getSVNInfo($path) {
|
||||||
|
|
||||||
if (empty($this->svnInfo[$path])) {
|
if (empty($this->svnInfo[$path])) {
|
||||||
|
|
||||||
if (empty($this->svnInfoRaw[$path])) {
|
if (empty($this->svnInfoRaw[$path])) {
|
||||||
|
|
|
@ -120,5 +120,4 @@ final class ArcanistRepositoryAPIStateTestCase extends ArcanistTestCase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API while running in the context of a commit hook
|
* API while running in the context of a commit hook.
|
||||||
*/
|
*/
|
||||||
abstract class ArcanistHookAPI {
|
abstract class ArcanistHookAPI {
|
||||||
abstract public function getCurrentFileData($path);
|
abstract public function getCurrentFileData($path);
|
||||||
|
|
|
@ -32,4 +32,5 @@ final class ArcanistSubversionHookAPI extends ArcanistHookAPI {
|
||||||
$this->root."/$path");
|
$this->root."/$path");
|
||||||
return ($err ? null : $file);
|
return ($err ? null : $file);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
* provides low-level APIs for reading "hg" output.
|
* provides low-level APIs for reading "hg" output.
|
||||||
*
|
*
|
||||||
* @task parse Parsing "hg" Output
|
* @task parse Parsing "hg" Output
|
||||||
* @group workingcopy
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistMercurialParser {
|
final class ArcanistMercurialParser {
|
||||||
|
|
||||||
|
|
|
@ -85,4 +85,5 @@ final class ArcanistMercurialParserTestCase extends ArcanistTestCase {
|
||||||
throw new Exception("No test information for test data '{$name}'!");
|
throw new Exception("No test information for test data '{$name}'!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the outcome of running a unit test.
|
* Represents the outcome of running a unit test.
|
||||||
*
|
|
||||||
* @group unit
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistUnitTestResult {
|
final class ArcanistUnitTestResult {
|
||||||
|
|
||||||
|
@ -78,8 +76,8 @@ final class ArcanistUnitTestResult {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* "extra data" allows an implementation to store additional
|
* "extra data" allows an implementation to store additional key/value
|
||||||
* key/value metadata along with the result of the test run.
|
* metadata along with the result of the test run.
|
||||||
*/
|
*/
|
||||||
public function setExtraData(array $extra_data = null) {
|
public function setExtraData(array $extra_data = null) {
|
||||||
$this->extraData = $extra_data;
|
$this->extraData = $extra_data;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract Base class for test result parsers
|
* Abstract Base class for test result parsers.
|
||||||
*/
|
*/
|
||||||
abstract class ArcanistBaseTestResultParser {
|
abstract class ArcanistBaseTestResultParser {
|
||||||
|
|
||||||
|
@ -12,25 +12,21 @@ abstract class ArcanistBaseTestResultParser {
|
||||||
|
|
||||||
public function setEnableCoverage($enable_coverage) {
|
public function setEnableCoverage($enable_coverage) {
|
||||||
$this->enableCoverage = $enable_coverage;
|
$this->enableCoverage = $enable_coverage;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setProjectRoot($project_root) {
|
public function setProjectRoot($project_root) {
|
||||||
$this->projectRoot = $project_root;
|
$this->projectRoot = $project_root;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setCoverageFile($coverage_file) {
|
public function setCoverageFile($coverage_file) {
|
||||||
$this->coverageFile = $coverage_file;
|
$this->coverageFile = $coverage_file;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setAffectedTests($affected_tests) {
|
public function setAffectedTests($affected_tests) {
|
||||||
$this->affectedTests = $affected_tests;
|
$this->affectedTests = $affected_tests;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,4 +45,5 @@ abstract class ArcanistBaseTestResultParser {
|
||||||
* @return array ArcanistUnitTestResult
|
* @return array ArcanistUnitTestResult
|
||||||
*/
|
*/
|
||||||
abstract public function parseTestResults($path, $test_results);
|
abstract public function parseTestResults($path, $test_results);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages unit test execution.
|
* Manages unit test execution.
|
||||||
*
|
|
||||||
* @group unit
|
|
||||||
*/
|
*/
|
||||||
abstract class ArcanistBaseUnitTestEngine {
|
abstract class ArcanistBaseUnitTestEngine {
|
||||||
|
|
||||||
|
@ -105,12 +103,13 @@ abstract class ArcanistBaseUnitTestEngine {
|
||||||
abstract public function run();
|
abstract public function run();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modify the return value of this function in the child class, if
|
* Modify the return value of this function in the child class, if you do
|
||||||
* you do not need to echo the test results after all the tests have
|
* not need to echo the test results after all the tests have been run. This
|
||||||
* been run. This is the case for example when the child class
|
* is the case for example when the child class prints the tests results
|
||||||
* prints the tests results while the tests are running.
|
* while the tests are running.
|
||||||
*/
|
*/
|
||||||
public function shouldEchoTestResults() {
|
public function shouldEchoTestResults() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,14 +2,12 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parser for JUnit, NUnit, etc results format - https://gist.github.com/959290
|
* Parser for JUnit, NUnit, etc results format - https://gist.github.com/959290
|
||||||
*
|
|
||||||
* @group unitrun
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistXUnitTestResultParser {
|
final class ArcanistXUnitTestResultParser {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse test results from provided input and return an array
|
* Parse test results from provided input and return an array
|
||||||
* of ArcanistUnitTestResult
|
* of @{class:ArcanistUnitTestResult}.
|
||||||
*
|
*
|
||||||
* @param string $test_results String containing test results
|
* @param string $test_results String containing test results
|
||||||
*
|
*
|
||||||
|
@ -42,7 +40,7 @@ final class ArcanistXUnitTestResultParser {
|
||||||
$user_data = '';
|
$user_data = '';
|
||||||
|
|
||||||
// A skipped test is a test which was ignored using framework
|
// A skipped test is a test which was ignored using framework
|
||||||
// mechanizms (e.g. @skip decorator)
|
// mechanisms (e.g. @skip decorator)
|
||||||
$skipped = $testcase->getElementsByTagName('skipped');
|
$skipped = $testcase->getElementsByTagName('skipped');
|
||||||
if ($skipped->length > 0) {
|
if ($skipped->length > 0) {
|
||||||
$status = ArcanistUnitTestResult::RESULT_SKIP;
|
$status = ArcanistUnitTestResult::RESULT_SKIP;
|
||||||
|
@ -55,7 +53,7 @@ final class ArcanistXUnitTestResultParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Failure is a test which the code has explicitly failed by using
|
// Failure is a test which the code has explicitly failed by using
|
||||||
// the mechanizms for that purpose. e.g., via an assertEquals
|
// the mechanisms for that purpose. e.g., via an assertEquals
|
||||||
$failures = $testcase->getElementsByTagName('failure');
|
$failures = $testcase->getElementsByTagName('failure');
|
||||||
if ($failures->length > 0) {
|
if ($failures->length > 0) {
|
||||||
$status = ArcanistUnitTestResult::RESULT_FAIL;
|
$status = ArcanistUnitTestResult::RESULT_FAIL;
|
||||||
|
@ -68,8 +66,7 @@ final class ArcanistXUnitTestResultParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
// An errored test is one that had an unanticipated problem. e.g., an
|
// An errored test is one that had an unanticipated problem. e.g., an
|
||||||
// unchecked throwable, or a problem with an implementation of the
|
// unchecked throwable, or a problem with an implementation of the test.
|
||||||
// test.
|
|
||||||
$errors = $testcase->getElementsByTagName('error');
|
$errors = $testcase->getElementsByTagName('error');
|
||||||
if ($errors->length > 0) {
|
if ($errors->length > 0) {
|
||||||
$status = ArcanistUnitTestResult::RESULT_BROKEN;
|
$status = ArcanistUnitTestResult::RESULT_BROKEN;
|
||||||
|
|
|
@ -6,10 +6,7 @@
|
||||||
* This engine inherits from `XUnitTestEngine`, where xUnit is used to actually
|
* This engine inherits from `XUnitTestEngine`, where xUnit is used to actually
|
||||||
* run the unit tests and this class provides a thin layer on top to collect
|
* run the unit tests and this class provides a thin layer on top to collect
|
||||||
* code coverage data with a third-party tool.
|
* code coverage data with a third-party tool.
|
||||||
*
|
|
||||||
* @group unitrun
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
final class CSharpToolsTestEngine extends XUnitTestEngine {
|
final class CSharpToolsTestEngine extends XUnitTestEngine {
|
||||||
|
|
||||||
private $cscoverHintPath;
|
private $cscoverHintPath;
|
||||||
|
@ -19,19 +16,17 @@ final class CSharpToolsTestEngine extends XUnitTestEngine {
|
||||||
private $excludedFiles;
|
private $excludedFiles;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overridden version of `loadEnvironment` to support a different set
|
* Overridden version of `loadEnvironment` to support a different set of
|
||||||
* of configuration values and to pull in the cstools config for
|
* configuration values and to pull in the cstools config for code coverage.
|
||||||
* code coverage.
|
|
||||||
*/
|
*/
|
||||||
protected function loadEnvironment() {
|
protected function loadEnvironment() {
|
||||||
|
|
||||||
$config = $this->getConfigurationManager();
|
$config = $this->getConfigurationManager();
|
||||||
$this->cscoverHintPath =
|
$this->cscoverHintPath = $config->getConfigFromAnySource(
|
||||||
$config->getConfigFromAnySource('unit.csharp.cscover.binary');
|
'unit.csharp.cscover.binary');
|
||||||
$this->matchRegex =
|
$this->matchRegex = $config->getConfigFromAnySource(
|
||||||
$config->getConfigFromAnySource('unit.csharp.coverage.match');
|
'unit.csharp.coverage.match');
|
||||||
$this->excludedFiles =
|
$this->excludedFiles = $config->getConfigFromAnySource(
|
||||||
$config->getConfigFromAnySource('unit.csharp.coverage.excluded');
|
'unit.csharp.coverage.excluded');
|
||||||
|
|
||||||
parent::loadEnvironment();
|
parent::loadEnvironment();
|
||||||
|
|
||||||
|
@ -50,10 +45,8 @@ final class CSharpToolsTestEngine extends XUnitTestEngine {
|
||||||
$this->coverEngine = Filesystem::resolvePath($cscover);
|
$this->coverEngine = Filesystem::resolvePath($cscover);
|
||||||
} else {
|
} else {
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
'Unable to locate cscover coverage runner '.
|
'Unable to locate cscover coverage runner (have you built yet?)');
|
||||||
'(have you built yet?)');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -283,4 +276,5 @@ final class CSharpToolsTestEngine extends XUnitTestEngine {
|
||||||
$this->addCachedResults($cover_file, $reports);
|
$this->addCachedResults($cover_file, $reports);
|
||||||
return $reports;
|
return $reports;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,13 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* Go Test Result Parsing utility
|
* Go Test Result Parsing utility
|
||||||
*
|
*
|
||||||
* Intended to enable custom unit engines derived
|
* (To generate test output, run something like: `go test -v`)
|
||||||
* from Go's built-in test utility to reuse
|
|
||||||
* common business logic related to parsing
|
|
||||||
* Go test results.
|
|
||||||
*
|
|
||||||
* (To generate test output, run something like:
|
|
||||||
* `go test -v`)
|
|
||||||
*/
|
*/
|
||||||
final class GoTestResultParser extends ArcanistBaseTestResultParser {
|
final class GoTestResultParser extends ArcanistBaseTestResultParser {
|
||||||
|
|
||||||
|
@ -23,7 +17,6 @@ final class GoTestResultParser extends ArcanistBaseTestResultParser {
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function parseTestResults($path, $test_results) {
|
public function parseTestResults($path, $test_results) {
|
||||||
|
|
||||||
$test_results = explode("\n", $test_results);
|
$test_results = explode("\n", $test_results);
|
||||||
|
|
||||||
$results = array();
|
$results = array();
|
||||||
|
@ -137,4 +130,5 @@ final class GoTestResultParser extends ArcanistBaseTestResultParser {
|
||||||
|
|
||||||
return $test_case_results;
|
return $test_case_results;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,13 +4,10 @@
|
||||||
* Very basic 'nose' unit test engine wrapper.
|
* Very basic 'nose' unit test engine wrapper.
|
||||||
*
|
*
|
||||||
* Requires nose 1.1.3 for code coverage.
|
* Requires nose 1.1.3 for code coverage.
|
||||||
*
|
|
||||||
* @group unitrun
|
|
||||||
*/
|
*/
|
||||||
final class NoseTestEngine extends ArcanistBaseUnitTestEngine {
|
final class NoseTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
|
|
||||||
public function run() {
|
public function run() {
|
||||||
|
|
||||||
$paths = $this->getPaths();
|
$paths = $this->getPaths();
|
||||||
|
|
||||||
$affected_tests = array();
|
$affected_tests = array();
|
||||||
|
@ -52,9 +49,7 @@ final class NoseTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
$xunit_tmp = new TempFile();
|
$xunit_tmp = new TempFile();
|
||||||
$cover_tmp = new TempFile();
|
$cover_tmp = new TempFile();
|
||||||
|
|
||||||
$future = $this->buildTestFuture($test_path,
|
$future = $this->buildTestFuture($test_path, $xunit_tmp, $cover_tmp);
|
||||||
$xunit_tmp,
|
|
||||||
$cover_tmp);
|
|
||||||
|
|
||||||
$futures[$test_path] = $future;
|
$futures[$test_path] = $future;
|
||||||
$tmpfiles[$test_path] = array(
|
$tmpfiles[$test_path] = array(
|
||||||
|
@ -91,8 +86,8 @@ final class NoseTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
$xunit_tmp);
|
$xunit_tmp);
|
||||||
|
|
||||||
if ($this->getEnableCoverage() !== false) {
|
if ($this->getEnableCoverage() !== false) {
|
||||||
$cmd_line .= csprintf(' --with-coverage --cover-xml '.
|
$cmd_line .= csprintf(
|
||||||
'--cover-xml-file=%s',
|
' --with-coverage --cover-xml --cover-xml-file=%s',
|
||||||
$cover_tmp);
|
$cover_tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,13 +3,8 @@
|
||||||
/**
|
/**
|
||||||
* PHPUnit Result Parsing utility
|
* PHPUnit Result Parsing utility
|
||||||
*
|
*
|
||||||
* Intended to enable custom unit engines derived
|
* For an example on how to integrate with your test engine, see
|
||||||
* from phpunit to reuse common business logic related
|
* @{class:PhpunitTestEngine}.
|
||||||
* to parsing phpunit test results and reports
|
|
||||||
*
|
|
||||||
* For an example on how to integrate with your test
|
|
||||||
* engine, see PhpunitTestEngine.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
final class PhpunitResultParser extends ArcanistBaseTestResultParser {
|
final class PhpunitResultParser extends ArcanistBaseTestResultParser {
|
||||||
|
|
||||||
|
@ -22,7 +17,6 @@ final class PhpunitResultParser extends ArcanistBaseTestResultParser {
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function parseTestResults($path, $test_results) {
|
public function parseTestResults($path, $test_results) {
|
||||||
|
|
||||||
if (!$test_results) {
|
if (!$test_results) {
|
||||||
$result = id(new ArcanistUnitTestResult())
|
$result = id(new ArcanistUnitTestResult())
|
||||||
->setName($path)
|
->setName($path)
|
||||||
|
@ -163,7 +157,6 @@ final class PhpunitResultParser extends ArcanistBaseTestResultParser {
|
||||||
* valid.
|
* valid.
|
||||||
*
|
*
|
||||||
* @param string $json String containing JSON report
|
* @param string $json String containing JSON report
|
||||||
*
|
|
||||||
* @return array JSON decoded array
|
* @return array JSON decoded array
|
||||||
*/
|
*/
|
||||||
private function getJsonReport($json) {
|
private function getJsonReport($json) {
|
||||||
|
@ -186,4 +179,5 @@ final class PhpunitResultParser extends ArcanistBaseTestResultParser {
|
||||||
|
|
||||||
return $json;
|
return $json;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPUnit wrapper
|
* PHPUnit wrapper.
|
||||||
*
|
|
||||||
* To use, set unit.engine in .arcconfig, or use --engine flag
|
|
||||||
* with arc unit. Currently supports only class & test files
|
|
||||||
* (no directory support).
|
|
||||||
* To use custom phpunit configuration, set phpunit_config in
|
|
||||||
* .arcconfig (e.g. app/phpunit.xml.dist).
|
|
||||||
*
|
|
||||||
* @group unitrun
|
|
||||||
*/
|
*/
|
||||||
final class PhpunitTestEngine extends ArcanistBaseUnitTestEngine {
|
final class PhpunitTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
|
|
||||||
|
@ -19,7 +11,6 @@ final class PhpunitTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
private $projectRoot;
|
private $projectRoot;
|
||||||
|
|
||||||
public function run() {
|
public function run() {
|
||||||
|
|
||||||
$this->projectRoot = $this->getWorkingCopy()->getProjectRoot();
|
$this->projectRoot = $this->getWorkingCopy()->getProjectRoot();
|
||||||
$this->affectedTests = array();
|
$this->affectedTests = array();
|
||||||
foreach ($this->getPaths() as $path) {
|
foreach ($this->getPaths() as $path) {
|
||||||
|
@ -79,8 +70,6 @@ final class PhpunitTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
'json' => $json_tmp,
|
'json' => $json_tmp,
|
||||||
'clover' => $clover_tmp,
|
'clover' => $clover_tmp,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$results = array();
|
$results = array();
|
||||||
|
@ -99,7 +88,7 @@ final class PhpunitTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse test results from phpunit json report
|
* Parse test results from phpunit json report.
|
||||||
*
|
*
|
||||||
* @param string $path Path to test
|
* @param string $path Path to test
|
||||||
* @param string $json_tmp Path to phpunit json report
|
* @param string $json_tmp Path to phpunit json report
|
||||||
|
@ -257,8 +246,8 @@ final class PhpunitTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tries to find and update phpunit configuration file
|
* Tries to find and update phpunit configuration file based on
|
||||||
* based on phpunit_config option in .arcconfig
|
* `phpunit_config` option in `.arcconfig`.
|
||||||
*/
|
*/
|
||||||
private function prepareConfigFile() {
|
private function prepareConfigFile() {
|
||||||
$project_root = $this->projectRoot.DIRECTORY_SEPARATOR;
|
$project_root = $this->projectRoot.DIRECTORY_SEPARATOR;
|
||||||
|
@ -284,4 +273,5 @@ final class PhpunitTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Very basic unit test engine which runs libphutil tests.
|
* Very basic unit test engine which runs libphutil tests.
|
||||||
*
|
|
||||||
* @group unitrun
|
|
||||||
*/
|
*/
|
||||||
final class PhutilUnitTestEngine extends ArcanistBaseUnitTestEngine {
|
final class PhutilUnitTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Very basic 'py.test' unit test engine wrapper.
|
* Very basic 'py.test' unit test engine wrapper.
|
||||||
*
|
|
||||||
* @group unitrun
|
|
||||||
*/
|
*/
|
||||||
final class PytestTestEngine extends ArcanistBaseUnitTestEngine {
|
final class PytestTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
|
|
||||||
|
@ -27,12 +25,13 @@ final class PytestTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
public function buildTestFuture($junit_tmp, $cover_tmp) {
|
public function buildTestFuture($junit_tmp, $cover_tmp) {
|
||||||
$paths = $this->getPaths();
|
$paths = $this->getPaths();
|
||||||
|
|
||||||
$cmd_line = csprintf('py.test --junitxml %s',
|
$cmd_line = csprintf('py.test --junitxml %s', $junit_tmp);
|
||||||
$junit_tmp);
|
|
||||||
|
|
||||||
if ($this->getEnableCoverage() !== false) {
|
if ($this->getEnableCoverage() !== false) {
|
||||||
$cmd_line = csprintf('coverage run --source %s -m %C',
|
$cmd_line = csprintf(
|
||||||
$this->project_root, $cmd_line);
|
'coverage run --source %s -m %C',
|
||||||
|
$this->project_root,
|
||||||
|
$cmd_line);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ExecFuture('%C', $cmd_line);
|
return new ExecFuture('%C', $cmd_line);
|
||||||
|
@ -132,4 +131,5 @@ final class PytestTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
|
|
||||||
return $reports;
|
return $reports;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
* that the test assembly that verifies the functionality of `SomeAssembly` is
|
* that the test assembly that verifies the functionality of `SomeAssembly` is
|
||||||
* located at `SomeAssembly.Tests`.
|
* located at `SomeAssembly.Tests`.
|
||||||
*
|
*
|
||||||
* @group unitrun
|
|
||||||
* @concrete-extensible
|
* @concrete-extensible
|
||||||
*/
|
*/
|
||||||
class XUnitTestEngine extends ArcanistBaseUnitTestEngine {
|
class XUnitTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
|
@ -27,10 +26,10 @@ class XUnitTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines what executables and test paths to use. Between platforms
|
* Determines what executables and test paths to use. Between platforms this
|
||||||
* this also changes whether the test engine is run under .NET or Mono. It
|
* also changes whether the test engine is run under .NET or Mono. It also
|
||||||
* also ensures that all of the required binaries are available for the tests
|
* ensures that all of the required binaries are available for the tests to
|
||||||
* to run successfully.
|
* run successfully.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
@ -84,8 +83,8 @@ class XUnitTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main entry point for the test engine. Determines what assemblies to
|
* Main entry point for the test engine. Determines what assemblies to build
|
||||||
* build and test based on the files that have changed.
|
* and test based on the files that have changed.
|
||||||
*
|
*
|
||||||
* @return array Array of test results.
|
* @return array Array of test results.
|
||||||
*/
|
*/
|
||||||
|
@ -137,7 +136,8 @@ class XUnitTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
if (!$exists) {
|
if (!$exists) {
|
||||||
$results[] = array(
|
$results[] = array(
|
||||||
'project' => $project,
|
'project' => $project,
|
||||||
'assembly' => $assembly);
|
'assembly' => $assembly,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,6 @@ class XUnitTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
* @return array Array of test results.
|
* @return array Array of test results.
|
||||||
*/
|
*/
|
||||||
private function generateProjects() {
|
private function generateProjects() {
|
||||||
|
|
||||||
// No "Build" directory; so skip generation of projects.
|
// No "Build" directory; so skip generation of projects.
|
||||||
if (!is_dir(Filesystem::resolvePath($this->projectRoot.'/Build'))) {
|
if (!is_dir(Filesystem::resolvePath($this->projectRoot.'/Build'))) {
|
||||||
return array();
|
return array();
|
||||||
|
@ -302,9 +301,8 @@ class XUnitTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the future for running a unit test. This can be
|
* Build the future for running a unit test. This can be overridden to enable
|
||||||
* overridden to enable support for code coverage via
|
* support for code coverage via another tool.
|
||||||
* another tool
|
|
||||||
*
|
*
|
||||||
* @param string Name of the test assembly.
|
* @param string Name of the test assembly.
|
||||||
* @return array The future, output filename and coverage filename
|
* @return array The future, output filename and coverage filename
|
||||||
|
@ -340,7 +338,6 @@ class XUnitTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
* @return array Array of test results.
|
* @return array Array of test results.
|
||||||
*/
|
*/
|
||||||
private function testAssemblies(array $test_assemblies) {
|
private function testAssemblies(array $test_assemblies) {
|
||||||
|
|
||||||
$results = array();
|
$results = array();
|
||||||
|
|
||||||
// Build the futures for running the tests.
|
// Build the futures for running the tests.
|
||||||
|
@ -374,7 +371,6 @@ class XUnitTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
|
|
||||||
// Since it's not possible for the user to correct this error, we
|
// Since it's not possible for the user to correct this error, we
|
||||||
// ignore the fact the tests didn't run here.
|
// ignore the fact the tests didn't run here.
|
||||||
//
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,8 +379,8 @@ class XUnitTestEngine extends ArcanistBaseUnitTestEngine {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns null for this implementation as xUnit does not support code
|
* Returns null for this implementation as xUnit does not support code
|
||||||
* coverage directly. Override this method in another class to provide
|
* coverage directly. Override this method in another class to provide code
|
||||||
* code coverage information (also see `CSharpToolsUnitEngine`).
|
* coverage information (also see @{class:CSharpToolsUnitEngine}).
|
||||||
*
|
*
|
||||||
* @param string The name of the coverage file if one was provided by
|
* @param string The name of the coverage file if one was provided by
|
||||||
* `buildTestFuture`.
|
* `buildTestFuture`.
|
||||||
|
|
|
@ -2,11 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test for @{class:GoTestResultParser}.
|
* Test for @{class:GoTestResultParser}.
|
||||||
*
|
|
||||||
* (putting tests in your tests so you can test
|
|
||||||
* while you test)
|
|
||||||
*
|
|
||||||
* @group testcase
|
|
||||||
*/
|
*/
|
||||||
final class GoTestResultParserTestCase extends ArcanistTestCase {
|
final class GoTestResultParserTestCase extends ArcanistTestCase {
|
||||||
|
|
||||||
|
@ -107,4 +102,5 @@ final class GoTestResultParserTestCase extends ArcanistTestCase {
|
||||||
$result->getResult());
|
$result->getResult());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,13 +2,10 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for @{class:PHPUnitTestEngine}.
|
* Tests for @{class:PHPUnitTestEngine}.
|
||||||
*
|
|
||||||
* @group testcase
|
|
||||||
*/
|
*/
|
||||||
final class PHPUnitTestEngineTestCase extends ArcanistTestCase {
|
final class PHPUnitTestEngineTestCase extends ArcanistTestCase {
|
||||||
|
|
||||||
public function testSearchLocations() {
|
public function testSearchLocations() {
|
||||||
|
|
||||||
$path = '/path/to/some/file/X.php';
|
$path = '/path/to/some/file/X.php';
|
||||||
|
|
||||||
$this->assertEqual(
|
$this->assertEqual(
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Very meta test for @{class:PhutilUnitTestEngine}.
|
* Very meta test for @{class:PhutilUnitTestEngine}.
|
||||||
*
|
|
||||||
* @group testcase
|
|
||||||
*/
|
*/
|
||||||
final class PhutilUnitTestEngineTestCase extends ArcanistTestCase {
|
final class PhutilUnitTestEngineTestCase extends ArcanistTestCase {
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test for @{class:ArcanistXUnitTestResultParser}.
|
* Test for @{class:ArcanistXUnitTestResultParser}.
|
||||||
*
|
|
||||||
* (putting tests in your tests so you can test
|
|
||||||
* while you test)
|
|
||||||
*
|
|
||||||
* @group testcase
|
|
||||||
*/
|
*/
|
||||||
final class XUnitTestResultParserTestCase extends ArcanistTestCase {
|
final class XUnitTestResultParserTestCase extends ArcanistTestCase {
|
||||||
|
|
||||||
|
|
|
@ -388,9 +388,7 @@ abstract class ArcanistPhutilTestCase {
|
||||||
*
|
*
|
||||||
* @task internal
|
* @task internal
|
||||||
*/
|
*/
|
||||||
final public function __construct() {
|
final public function __construct() {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test for @{class:PhutilUnitTestEngineTestCase}.
|
* Test for @{class:PhutilUnitTestEngineTestCase}.
|
||||||
*
|
|
||||||
* @group testcase
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistPhutilTestCaseTestCase extends ArcanistPhutilTestCase {
|
final class ArcanistPhutilTestCaseTestCase extends ArcanistPhutilTestCase {
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,5 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thrown to skip test execution.
|
* Thrown to skip test execution.
|
||||||
*
|
|
||||||
* @group unitrun
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistPhutilTestSkippedException extends Exception {}
|
final class ArcanistPhutilTestSkippedException extends Exception {}
|
||||||
|
|
|
@ -2,7 +2,5 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thrown to prematurely end test execution.
|
* Thrown to prematurely end test execution.
|
||||||
*
|
|
||||||
* @group unitrun
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistPhutilTestTerminatedException extends Exception {}
|
final class ArcanistPhutilTestTerminatedException extends Exception {}
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
* @group unit
|
|
||||||
*/
|
|
||||||
final class ArcanistUnitConsoleRenderer extends ArcanistUnitRenderer {
|
final class ArcanistUnitConsoleRenderer extends ArcanistUnitRenderer {
|
||||||
|
|
||||||
public function renderUnitResult(ArcanistUnitTestResult $result) {
|
public function renderUnitResult(ArcanistUnitTestResult $result) {
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
* @group unit
|
|
||||||
*/
|
|
||||||
abstract class ArcanistUnitRenderer {
|
abstract class ArcanistUnitRenderer {
|
||||||
|
|
||||||
abstract public function renderUnitResult(ArcanistUnitTestResult $result);
|
abstract public function renderUnitResult(ArcanistUnitTestResult $result);
|
||||||
abstract public function renderPostponedResult($count);
|
abstract public function renderPostponedResult($count);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages aliases for commands with options.
|
* Manages aliases for commands with options.
|
||||||
*
|
|
||||||
* @group workflow
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistAliasWorkflow extends ArcanistBaseWorkflow {
|
final class ArcanistAliasWorkflow extends ArcanistBaseWorkflow {
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
* @group workflow
|
|
||||||
*/
|
|
||||||
final class ArcanistAnoidWorkflow extends ArcanistBaseWorkflow {
|
final class ArcanistAnoidWorkflow extends ArcanistBaseWorkflow {
|
||||||
|
|
||||||
public function getWorkflowName() {
|
public function getWorkflowName() {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* Runs git revert and assigns hi pri task to original author
|
|
||||||
* @group workflow
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs git revert and assigns a high priority task to original author.
|
||||||
|
*/
|
||||||
final class ArcanistBackoutWorkflow extends ArcanistBaseWorkflow {
|
final class ArcanistBackoutWorkflow extends ArcanistBaseWorkflow {
|
||||||
|
|
||||||
private $console;
|
private $console;
|
||||||
private $conduit;
|
private $conduit;
|
||||||
private $revision;
|
private $revision;
|
||||||
|
@ -49,7 +49,9 @@ EOTEXT
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Given a differential revision ID, fetches the commit ID
|
/**
|
||||||
|
* Given a differential revision ID, fetches the commit ID.
|
||||||
|
*/
|
||||||
private function getCommitIDFromRevisionID($revision_id) {
|
private function getCommitIDFromRevisionID($revision_id) {
|
||||||
$conduit = $this->getConduit();
|
$conduit = $this->getConduit();
|
||||||
$revisions = $conduit->callMethodSynchronous(
|
$revisions = $conduit->callMethodSynchronous(
|
||||||
|
@ -81,8 +83,10 @@ EOTEXT
|
||||||
return $commit_id;
|
return $commit_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetches an array of commit info provided a Commit_id
|
/**
|
||||||
// in the form of rE123456 (not local commit hash)
|
* Fetches an array of commit info provided a Commit_id in the form of
|
||||||
|
* rE123456 (not local commit hash).
|
||||||
|
*/
|
||||||
private function getDiffusionCommit($commit_id) {
|
private function getDiffusionCommit($commit_id) {
|
||||||
$result = $this->getConduit()->callMethodSynchronous(
|
$result = $this->getConduit()->callMethodSynchronous(
|
||||||
'diffusion.getcommits',
|
'diffusion.getcommits',
|
||||||
|
@ -97,13 +101,16 @@ EOTEXT
|
||||||
return $commit;
|
return $commit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieves default template from differential and prefills info
|
/**
|
||||||
|
* Retrieves default template from differential and pre-fills info.
|
||||||
|
*/
|
||||||
private function buildCommitMessage($commit_hash) {
|
private function buildCommitMessage($commit_hash) {
|
||||||
$conduit = $this->getConduit();
|
$conduit = $this->getConduit();
|
||||||
$repository_api = $this->getRepositoryAPI();
|
$repository_api = $this->getRepositoryAPI();
|
||||||
|
|
||||||
$summary = $repository_api->getBackoutMessage($commit_hash);
|
$summary = $repository_api->getBackoutMessage($commit_hash);
|
||||||
$fields = array('summary' => $summary,
|
$fields = array(
|
||||||
|
'summary' => $summary,
|
||||||
'testPlan' => 'revert-hammer',
|
'testPlan' => 'revert-hammer',
|
||||||
);
|
);
|
||||||
$template = $conduit->callMethodSynchronous(
|
$template = $conduit->callMethodSynchronous(
|
||||||
|
@ -119,7 +126,9 @@ EOTEXT
|
||||||
return $template;
|
return $template;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Performs the backout/revert of a revision and creates a commit
|
/**
|
||||||
|
* Performs the backout/revert of a revision and creates a commit.
|
||||||
|
*/
|
||||||
public function run() {
|
public function run() {
|
||||||
$console = PhutilConsole::getConsole();
|
$console = PhutilConsole::getConsole();
|
||||||
$conduit = $this->getConduit();
|
$conduit = $this->getConduit();
|
||||||
|
@ -163,8 +172,8 @@ EOTEXT
|
||||||
$commit_hash = $input[0];
|
$commit_hash = $input[0];
|
||||||
}
|
}
|
||||||
if (!$repository_api->hasLocalCommit($commit_hash)) {
|
if (!$repository_api->hasLocalCommit($commit_hash)) {
|
||||||
throw new ArcanistUsageException('Invalid commit provided or does not'.
|
throw new ArcanistUsageException(
|
||||||
'exist in the working copy!');
|
'Invalid commit provided or does not exist in the working copy!');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run 'backout'.
|
// Run 'backout'.
|
||||||
|
@ -177,6 +186,6 @@ EOTEXT
|
||||||
$message = $this->buildCommitMessage($commit_hash);
|
$message = $this->buildCommitMessage($commit_hash);
|
||||||
$repository_api->doCommit($message);
|
$repository_api->doCommit($message);
|
||||||
$console->writeOut("Double-check the commit and push when ready\n");
|
$console->writeOut("Double-check the commit and push when ready\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,9 +76,7 @@ abstract class ArcanistBaseWorkflow extends Phobject {
|
||||||
private $changeCache = array();
|
private $changeCache = array();
|
||||||
|
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
abstract public function run();
|
abstract public function run();
|
||||||
|
@ -320,11 +318,13 @@ abstract class ArcanistBaseWorkflow extends Phobject {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($credentials['user'])) {
|
if (empty($credentials['user'])) {
|
||||||
throw new ConduitClientException('ERR-INVALID-USER',
|
throw new ConduitClientException(
|
||||||
|
'ERR-INVALID-USER',
|
||||||
'Empty user in credentials.');
|
'Empty user in credentials.');
|
||||||
}
|
}
|
||||||
if (empty($credentials['certificate'])) {
|
if (empty($credentials['certificate'])) {
|
||||||
throw new ConduitClientException('ERR-NO-CERTIFICATE',
|
throw new ConduitClientException(
|
||||||
|
'ERR-NO-CERTIFICATE',
|
||||||
'Empty certificate in credentials.');
|
'Empty certificate in credentials.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Alias for arc feature
|
* Alias for `arc feature`.
|
||||||
*
|
|
||||||
* @group workflow
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistBookmarkWorkflow extends ArcanistFeatureWorkflow {
|
final class ArcanistBookmarkWorkflow extends ArcanistFeatureWorkflow {
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Alias for arc feature
|
* Alias for `arc feature`.
|
||||||
*
|
|
||||||
* @group workflow
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistBranchWorkflow extends ArcanistFeatureWorkflow {
|
final class ArcanistBranchWorkflow extends ArcanistFeatureWorkflow {
|
||||||
|
|
||||||
|
|
|
@ -137,4 +137,5 @@ EOTEXT
|
||||||
"Unable to find a browser command to run. Set 'browser' in your ".
|
"Unable to find a browser command to run. Set 'browser' in your ".
|
||||||
"arc config to specify one."));
|
"arc config to specify one."));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides command-line access to the Conduit API.
|
* Provides command-line access to the Conduit API.
|
||||||
*
|
|
||||||
* @group workflow
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistCallConduitWorkflow extends ArcanistBaseWorkflow {
|
final class ArcanistCallConduitWorkflow extends ArcanistBaseWorkflow {
|
||||||
|
|
||||||
|
@ -91,4 +89,5 @@ EOTEXT
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Explicitly closes Differential revisions.
|
* Explicitly closes Differential revisions.
|
||||||
*
|
|
||||||
* @group workflow
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistCloseRevisionWorkflow extends ArcanistBaseWorkflow {
|
final class ArcanistCloseRevisionWorkflow extends ArcanistBaseWorkflow {
|
||||||
|
|
||||||
|
@ -151,4 +149,5 @@ EOTEXT
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close a task
|
* Close a task.
|
||||||
*
|
|
||||||
* @group workflow
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistCloseWorkflow extends ArcanistBaseWorkflow {
|
final class ArcanistCloseWorkflow extends ArcanistBaseWorkflow {
|
||||||
|
|
||||||
|
@ -73,7 +71,8 @@ EOTEXT
|
||||||
'status' => array(
|
'status' => array(
|
||||||
'param' => 'status',
|
'param' => 'status',
|
||||||
'short' => 's',
|
'short' => 's',
|
||||||
'help' => pht('Specify a new status. Valid status options can be '.
|
'help' => pht(
|
||||||
|
'Specify a new status. Valid status options can be '.
|
||||||
'seen with the `list-statuses` argument.'),
|
'seen with the `list-statuses` argument.'),
|
||||||
),
|
),
|
||||||
'list-statuses' => array(
|
'list-statuses' => array(
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes "svn commit" once a revision has been "Accepted".
|
* Executes "svn commit" once a revision has been "Accepted".
|
||||||
*
|
|
||||||
* @group workflow
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistCommitWorkflow extends ArcanistBaseWorkflow {
|
final class ArcanistCommitWorkflow extends ArcanistBaseWorkflow {
|
||||||
|
|
||||||
|
@ -336,5 +334,4 @@ EOTEXT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Covers your professional reputation by blaming changes to locate reviewers.
|
* Covers your professional reputation by blaming changes to locate reviewers.
|
||||||
*
|
|
||||||
* @group workflow
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistCoverWorkflow extends ArcanistBaseWorkflow {
|
final class ArcanistCoverWorkflow extends ArcanistBaseWorkflow {
|
||||||
|
|
||||||
|
@ -63,7 +61,6 @@ EOTEXT
|
||||||
}
|
}
|
||||||
|
|
||||||
public function run() {
|
public function run() {
|
||||||
|
|
||||||
$repository_api = $this->getRepositoryAPI();
|
$repository_api = $this->getRepositoryAPI();
|
||||||
|
|
||||||
$in_paths = $this->getArgument('paths');
|
$in_paths = $this->getArgument('paths');
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
* @task message Commit and Update Messages
|
* @task message Commit and Update Messages
|
||||||
* @task diffspec Diff Specification
|
* @task diffspec Diff Specification
|
||||||
* @task diffprop Diff Properties
|
* @task diffprop Diff Properties
|
||||||
*
|
|
||||||
* @group workflow
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistDiffWorkflow extends ArcanistBaseWorkflow {
|
final class ArcanistDiffWorkflow extends ArcanistBaseWorkflow {
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Download a file from Phabricator.
|
* Download a file from Phabricator.
|
||||||
*
|
|
||||||
* @group workflow
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistDownloadWorkflow extends ArcanistBaseWorkflow {
|
final class ArcanistDownloadWorkflow extends ArcanistBaseWorkflow {
|
||||||
|
|
||||||
|
@ -36,7 +34,8 @@ EOTEXT
|
||||||
return array(
|
return array(
|
||||||
'show' => array(
|
'show' => array(
|
||||||
'conflicts' => array(
|
'conflicts' => array(
|
||||||
'as' => 'Use --show to direct the file to stdout, or --as to direct '.
|
'as' =>
|
||||||
|
'Use --show to direct the file to stdout, or --as to direct '.
|
||||||
'it to a named location.',
|
'it to a named location.',
|
||||||
),
|
),
|
||||||
'help' => 'Write file to stdout instead of to disk.',
|
'help' => 'Write file to stdout instead of to disk.',
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exports changes from Differential or the working copy to a file.
|
* Exports changes from Differential or the working copy to a file.
|
||||||
*
|
|
||||||
* @group workflow
|
|
||||||
*/
|
*/
|
||||||
final class ArcanistExportWorkflow extends ArcanistBaseWorkflow {
|
final class ArcanistExportWorkflow extends ArcanistBaseWorkflow {
|
||||||
|
|
||||||
|
@ -84,7 +82,6 @@ EOTEXT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function didParseArguments() {
|
protected function didParseArguments() {
|
||||||
$source = self::SOURCE_LOCAL;
|
$source = self::SOURCE_LOCAL;
|
||||||
$requested = 0;
|
$requested = 0;
|
||||||
|
@ -109,7 +106,6 @@ EOTEXT
|
||||||
"one change source.");
|
"one change source.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$format = null;
|
$format = null;
|
||||||
$requested = 0;
|
$requested = 0;
|
||||||
if ($this->getArgument('git')) {
|
if ($this->getArgument('git')) {
|
||||||
|
@ -167,7 +163,6 @@ EOTEXT
|
||||||
}
|
}
|
||||||
|
|
||||||
public function run() {
|
public function run() {
|
||||||
|
|
||||||
$source = $this->getSource();
|
$source = $this->getSource();
|
||||||
|
|
||||||
switch ($source) {
|
switch ($source) {
|
||||||
|
@ -218,7 +213,7 @@ EOTEXT
|
||||||
$bundle->setProjectID($this->getWorkingCopy()->getProjectID());
|
$bundle->setProjectID($this->getWorkingCopy()->getProjectID());
|
||||||
$bundle->setBaseRevision(
|
$bundle->setBaseRevision(
|
||||||
$repository_api->getSourceControlBaseRevision());
|
$repository_api->getSourceControlBaseRevision());
|
||||||
// note we can't get a revision ID for SOURCE_LOCAL
|
// NOTE: we can't get a revision ID for SOURCE_LOCAL
|
||||||
|
|
||||||
$parser = new PhutilEmailAddress($author);
|
$parser = new PhutilEmailAddress($author);
|
||||||
$bundle->setAuthorName($parser->getDisplayName());
|
$bundle->setAuthorName($parser->getDisplayName());
|
||||||
|
@ -273,4 +268,5 @@ EOTEXT
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays user's Git branches or Mercurial bookmarks
|
* Displays user's Git branches or Mercurial bookmarks.
|
||||||
*
|
*
|
||||||
* @group workflow
|
|
||||||
* @concrete-extensible
|
* @concrete-extensible
|
||||||
*/
|
*/
|
||||||
class ArcanistFeatureWorkflow extends ArcanistBaseWorkflow {
|
class ArcanistFeatureWorkflow extends ArcanistBaseWorkflow {
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
* @group workflow
|
|
||||||
*/
|
|
||||||
final class ArcanistFlagWorkflow extends ArcanistBaseWorkflow {
|
final class ArcanistFlagWorkflow extends ArcanistBaseWorkflow {
|
||||||
|
|
||||||
private static $colorMap = array(
|
private static $colorMap = array(
|
||||||
|
@ -60,18 +57,18 @@ EOTEXT
|
||||||
return array(
|
return array(
|
||||||
'*' => 'objects',
|
'*' => 'objects',
|
||||||
'clear' => array(
|
'clear' => array(
|
||||||
'help' => 'Delete the flag on an object.'
|
'help' => 'Delete the flag on an object.',
|
||||||
),
|
),
|
||||||
'edit' => array(
|
'edit' => array(
|
||||||
'help' => 'Edit the flag on an object.'
|
'help' => 'Edit the flag on an object.',
|
||||||
),
|
),
|
||||||
'color' => array(
|
'color' => array(
|
||||||
'param' => 'color',
|
'param' => 'color',
|
||||||
'help' => 'Set the color of a flag.'
|
'help' => 'Set the color of a flag.',
|
||||||
),
|
),
|
||||||
'note' => array(
|
'note' => array(
|
||||||
'param' => 'note',
|
'param' => 'note',
|
||||||
'help' => 'Set the note on a flag.'
|
'help' => 'Set the note on a flag.',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue