diff --git a/scripts/__init_script__.php b/scripts/__init_script__.php --- a/scripts/__init_script__.php +++ b/scripts/__init_script__.php @@ -11,7 +11,6 @@ * When looking in these places, we expect to find a 'libphutil/' directory. */ function arcanist_adjust_php_include_path() { - // The 'arcanist/' directory. $arcanist_dir = dirname(dirname(__FILE__)); diff --git a/src/configuration/ArcanistConfiguration.php b/src/configuration/ArcanistConfiguration.php --- a/src/configuration/ArcanistConfiguration.php +++ b/src/configuration/ArcanistConfiguration.php @@ -17,7 +17,6 @@ * - add new flags to existing workflows by overriding * getCustomArgumentsForCommand(). * - * @group config * @concrete-extensible */ class ArcanistConfiguration { @@ -65,8 +64,11 @@ // This is a hook. } - public function didRunWorkflow($command, ArcanistBaseWorkflow $workflow, - $err) { + public function didRunWorkflow( + $command, + ArcanistBaseWorkflow $workflow, + $err) { + // This is a hook. } diff --git a/src/configuration/ArcanistConfigurationManager.php b/src/configuration/ArcanistConfigurationManager.php --- a/src/configuration/ArcanistConfigurationManager.php +++ b/src/configuration/ArcanistConfigurationManager.php @@ -2,8 +2,6 @@ /** * This class holds everything related to configuration and configuration files. - * - * @group config */ final class ArcanistConfigurationManager { diff --git a/src/configuration/ArcanistSettings.php b/src/configuration/ArcanistSettings.php --- a/src/configuration/ArcanistSettings.php +++ b/src/configuration/ArcanistSettings.php @@ -1,8 +1,5 @@ 'bool', 'help' => 'Whether arc should permit the automatic stashing of changes in '. - 'the working directory when requiring a clean working copy. '. + 'the working directory when requiring a clean working copy. '. 'This option should only be used when users understand how '. 'to restore their working directory from the local stash if '. 'an Arcanist operation causes an unrecoverable error.', @@ -329,5 +326,4 @@ return $value; } - } diff --git a/src/configuration/__tests__/ArcanistBritishTestCase.php b/src/configuration/__tests__/ArcanistBritishTestCase.php --- a/src/configuration/__tests__/ArcanistBritishTestCase.php +++ b/src/configuration/__tests__/ArcanistBritishTestCase.php @@ -56,7 +56,6 @@ "Correction of {$input} against: {$commands}"); } - public function testArgumentCompletion() { $this->assertArgumentCompletion( array('nolint'), diff --git a/src/difference/ArcanistDiffUtils.php b/src/difference/ArcanistDiffUtils.php --- a/src/difference/ArcanistDiffUtils.php +++ b/src/difference/ArcanistDiffUtils.php @@ -2,8 +2,6 @@ /** * Dumping ground for diff- and diff-algorithm-related miscellany. - * - * @group diff */ final class ArcanistDiffUtils { diff --git a/src/difference/__tests__/ArcanistDiffUtilsTestCase.php b/src/difference/__tests__/ArcanistDiffUtilsTestCase.php --- a/src/difference/__tests__/ArcanistDiffUtilsTestCase.php +++ b/src/difference/__tests__/ArcanistDiffUtilsTestCase.php @@ -2,71 +2,70 @@ /** * Test cases for @{class:ArcanistDiffUtils}. - * - * @group testcase */ final class ArcanistDiffUtilsTestCase extends ArcanistTestCase { + public function testLevenshtein() { $tests = array( array( 'a', 'b', - 'x' + 'x', ), array( 'kalrmr(array($b))', 'array($b)', - 'dddddddssssssssds' + 'dddddddssssssssds', ), array( 'array($b)', 'kalrmr(array($b))', - 'iiiiiiissssssssis' + 'iiiiiiissssssssis', ), array( 'zkalrmr(array($b))z', 'xarray($b)x', - 'dddddddxsssssssssdx' + 'dddddddxsssssssssdx', ), array( 'xarray($b)x', 'zkalrmr(array($b))z', - 'iiiiiiixsssssssssix' + 'iiiiiiixsssssssssix', ), array( 'abcdefghi', 'abcdefghi', - 'sssssssss' + 'sssssssss', ), array( 'abcdefghi', 'abcdefghijkl', - 'sssssssssiii' + 'sssssssssiii', ), array( 'abcdefghijkl', 'abcdefghi', - 'sssssssssddd' + 'sssssssssddd', ), array( 'xyzabcdefghi', 'abcdefghi', - 'dddsssssssss' + 'dddsssssssss', ), array( 'abcdefghi', 'xyzabcdefghi', - 'iiisssssssss' + 'iiisssssssss', ), array( 'abcdefg', 'abxdxfg', - 'ssxsxss' + 'ssxsxss', ), array( 'private function a($a, $b) {', 'public function and($b, $c) {', - 'siixsdddxsssssssssssiissxsssxsss' + 'siixsdddxsssssssssssiissxsssxsss', ), array( @@ -121,9 +120,9 @@ $left = ''; $right = ''; $result = array( - array(array(0, 0)), - array(array(0, 0)) - ); + array(array(0, 0)), + array(array(0, 0)), + ); $this->assertEqual( $result, ArcanistDiffUtils::generateIntralineDiff($left, $right)); @@ -132,9 +131,9 @@ $left = ''; $right = "Grumpy\xE2\x98\x83at"; $result = array( - array(array(0, 0)), - array(array(0, 11)) - ); + array(array(0, 0)), + array(array(0, 11)), + ); $this->assertEqual( $result, ArcanistDiffUtils::generateIntralineDiff($left, $right)); @@ -143,9 +142,9 @@ $left = "Grumpy\xE2\x98\x83at"; $right = ''; $result = array( - array(array(0, 11)), - array(array(0, 0)) - ); + array(array(0, 11)), + array(array(0, 0)), + ); $this->assertEqual( $result, ArcanistDiffUtils::generateIntralineDiff($left, $right)); @@ -154,9 +153,9 @@ $left = "Grumpy\xE2\x98\x83at"; $right = "Grumpy\xE2\x98\x83at"; $result = array( - array(array(0, 11)), - array(array(0, 11)) - ); + array(array(0, 11)), + array(array(0, 11)), + ); $this->assertEqual( $result, ArcanistDiffUtils::generateIntralineDiff($left, $right)); @@ -165,9 +164,9 @@ $left = "Grumpy\xE2\x98\x83at"; $right = 'Smiling Dog'; $result = array( - array(array(1, 11)), - array(array(1, 11)) - ); + array(array(1, 11)), + array(array(1, 11)), + ); $this->assertEqual( $result, ArcanistDiffUtils::generateIntralineDiff($left, $right)); @@ -176,9 +175,9 @@ $left = 'GrumpyCat'; $right = "Grumpy\xE2\x98\x83at"; $result = array( - 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, 1), array(0, 2)), + array(array(0, 6), array(1, 3), array(0, 2)), + ); $this->assertEqual( $result, ArcanistDiffUtils::generateIntralineDiff($left, $right)); @@ -187,9 +186,9 @@ $left = 'GrumpyCat'; $right = "Grumpy\xE2\x98\x83a\xE2\x98\x83t"; $result = array( - 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, 2), array(0, 1)), + array(array(0, 6), array(1, 7), array(0, 1)), + ); $this->assertEqual( $result, ArcanistDiffUtils::generateIntralineDiff($left, $right)); @@ -198,9 +197,9 @@ $left = "GrumpyC\xE2\x98\x83t"; $right = "DrumpyC\xE2\x98\x83t"; $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( $result, ArcanistDiffUtils::generateIntralineDiff($left, $right)); @@ -209,9 +208,9 @@ $left = "GrumpyC\xE2\x98\x83t"; $right = "GrumpyC\xE2\x98\x83P"; $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( $result, ArcanistDiffUtils::generateIntralineDiff($left, $right)); @@ -220,9 +219,9 @@ $left = "GrumpyC\xE2\x98\x83t"; $right = "DrumpyC\xE2\x98\x83P"; $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( $result, ArcanistDiffUtils::generateIntralineDiff($left, $right)); @@ -232,11 +231,12 @@ $left = 'Senor'; $right = "Sen{$cc}or"; $result = array( - 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, 1), array(0, 2)), + array(array(0, 2), array(1, 3), array(0, 2)), + ); $this->assertEqual( $result, ArcanistDiffUtils::generateIntralineDiff($left, $right)); } + } diff --git a/src/differential/ArcanistDifferentialCommitMessage.php b/src/differential/ArcanistDifferentialCommitMessage.php --- a/src/differential/ArcanistDifferentialCommitMessage.php +++ b/src/differential/ArcanistDifferentialCommitMessage.php @@ -2,8 +2,6 @@ /** * Represents a parsed commit message. - * - * @group differential */ final class ArcanistDifferentialCommitMessage { diff --git a/src/differential/ArcanistDifferentialCommitMessageParserException.php b/src/differential/ArcanistDifferentialCommitMessageParserException.php --- a/src/differential/ArcanistDifferentialCommitMessageParserException.php +++ b/src/differential/ArcanistDifferentialCommitMessageParserException.php @@ -2,8 +2,6 @@ /** * Thrown when a commit message isn't parseable. - * - * @group differential */ final class ArcanistDifferentialCommitMessageParserException extends Exception { diff --git a/src/events/constant/ArcanistEventType.php b/src/events/constant/ArcanistEventType.php --- a/src/events/constant/ArcanistEventType.php +++ b/src/events/constant/ArcanistEventType.php @@ -12,4 +12,5 @@ const TYPE_REVISION_WILLCREATEREVISION = 'revision.willCreateRevision'; const TYPE_LAND_WILLPUSHREVISION = 'land.willPushRevision'; + } diff --git a/src/exception/ArcanistChooseInvalidRevisionException.php b/src/exception/ArcanistChooseInvalidRevisionException.php --- a/src/exception/ArcanistChooseInvalidRevisionException.php +++ b/src/exception/ArcanistChooseInvalidRevisionException.php @@ -2,9 +2,5 @@ /** * 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 {} diff --git a/src/exception/ArcanistChooseNoRevisionsException.php b/src/exception/ArcanistChooseNoRevisionsException.php --- a/src/exception/ArcanistChooseNoRevisionsException.php +++ b/src/exception/ArcanistChooseNoRevisionsException.php @@ -3,9 +3,5 @@ /** * Thrown when there are no valid revisions to choose from, in a workflow which * prompts the user to choose a revision. - * - * @group workflow */ -final class ArcanistChooseNoRevisionsException extends Exception { - -} +final class ArcanistChooseNoRevisionsException extends Exception {} diff --git a/src/exception/ArcanistUsageException.php b/src/exception/ArcanistUsageException.php --- a/src/exception/ArcanistUsageException.php +++ b/src/exception/ArcanistUsageException.php @@ -4,9 +4,6 @@ * Thrown when there is a problem with how a user is invoking a command, rather * than a technical problem. * - * @group workflow * @concrete-extensible */ -class ArcanistUsageException extends Exception { - -} +class ArcanistUsageException extends Exception {} diff --git a/src/exception/usage/ArcanistNoEffectException.php b/src/exception/usage/ArcanistNoEffectException.php --- a/src/exception/usage/ArcanistNoEffectException.php +++ b/src/exception/usage/ArcanistNoEffectException.php @@ -3,8 +3,5 @@ /** * Thrown when lint or unit tests have no effect, i.e. no paths are affected * by any linter or no unit tests provide coverage. - * - * @group workflow */ -final class ArcanistNoEffectException extends ArcanistUsageException { -} +final class ArcanistNoEffectException extends ArcanistUsageException {} diff --git a/src/exception/usage/ArcanistNoEngineException.php b/src/exception/usage/ArcanistNoEngineException.php --- a/src/exception/usage/ArcanistNoEngineException.php +++ b/src/exception/usage/ArcanistNoEngineException.php @@ -2,8 +2,5 @@ /** * Thrown when no engine is configured for linting or running unit tests. - * - * @group workflow */ -final class ArcanistNoEngineException extends ArcanistUsageException { -} +final class ArcanistNoEngineException extends ArcanistUsageException {} diff --git a/src/exception/usage/ArcanistUserAbortException.php b/src/exception/usage/ArcanistUserAbortException.php --- a/src/exception/usage/ArcanistUserAbortException.php +++ b/src/exception/usage/ArcanistUserAbortException.php @@ -3,11 +3,11 @@ /** * Thrown when the user chooses not to continue when warned that they're about * to do something dangerous. - * - * @group workflow */ final class ArcanistUserAbortException extends ArcanistUsageException { + public function __construct() { parent::__construct('User aborted the workflow.'); } + } diff --git a/src/hgdaemon/ArcanistHgProxyClient.php b/src/hgdaemon/ArcanistHgProxyClient.php --- a/src/hgdaemon/ArcanistHgProxyClient.php +++ b/src/hgdaemon/ArcanistHgProxyClient.php @@ -1,6 +1,5 @@ effectiveMessages = $messages; $this->needsSort = false; - } } diff --git a/src/lint/ArcanistLintSeverity.php b/src/lint/ArcanistLintSeverity.php --- a/src/lint/ArcanistLintSeverity.php +++ b/src/lint/ArcanistLintSeverity.php @@ -2,8 +2,6 @@ /** * Describes the severity of an @{class:ArcanistLintMessage}. - * - * @group lint */ final class ArcanistLintSeverity { @@ -34,7 +32,6 @@ } public static function isAtLeastAsSevere($message_sev, $level) { - static $map = array( self::SEVERITY_DISABLED => 10, self::SEVERITY_ADVICE => 20, @@ -50,5 +47,4 @@ return $map[$message_sev] >= idx($map, $level, 0); } - } diff --git a/src/lint/engine/ArcanistLintEngine.php b/src/lint/engine/ArcanistLintEngine.php --- a/src/lint/engine/ArcanistLintEngine.php +++ b/src/lint/engine/ArcanistLintEngine.php @@ -39,7 +39,6 @@ * See @{article@phabricator:Arcanist User Guide: Customizing Lint, Unit Tests * and Workflows} for more information about configuring lint engines. * - * @group lint * @stable */ abstract class ArcanistLintEngine { @@ -385,8 +384,10 @@ return ArcanistLintSeverity::isAtLeastAsSevere($severity, $minimum); } - final private function shouldUseCache($cache_granularity, - $repository_version) { + final private function shouldUseCache( + $cache_granularity, + $repository_version) { + if ($this->commitHookMode) { return false; } @@ -580,5 +581,4 @@ return $this; } - } diff --git a/src/lint/engine/ArcanistSingleLintEngine.php b/src/lint/engine/ArcanistSingleLintEngine.php --- a/src/lint/engine/ArcanistSingleLintEngine.php +++ b/src/lint/engine/ArcanistSingleLintEngine.php @@ -8,8 +8,6 @@ * * Set which linter should be run by configuring `lint.engine.single.linter` in * `.arcconfig` or user config. - * - * @group linter */ final class ArcanistSingleLintEngine extends ArcanistLintEngine { @@ -60,4 +58,5 @@ return array($linter); } + } diff --git a/src/lint/engine/ComprehensiveLintEngine.php b/src/lint/engine/ComprehensiveLintEngine.php --- a/src/lint/engine/ComprehensiveLintEngine.php +++ b/src/lint/engine/ComprehensiveLintEngine.php @@ -1,9 +1,7 @@ resolve(); if ($err !== 0) { throw new Exception( - 'You are running an old version of cslint. Please '. + 'You are running an old version of cslint. Please '. 'upgrade to version '.self::SUPPORTED_VERSION.'.'); } $ver = (int)$stdout; if ($ver < self::SUPPORTED_VERSION) { throw new Exception( - 'You are running an old version of cslint. Please '. + 'You are running an old version of cslint. Please '. 'upgrade to version '.self::SUPPORTED_VERSION.'.'); } else if ($ver > self::SUPPORTED_VERSION) { throw new Exception( 'Arcanist does not support this version of cslint (it is '. - 'newer). You can try upgrading Arcanist with `arc upgrade`.'); + 'newer). You can try upgrading Arcanist with `arc upgrade`.'); } $this->loaded = true; @@ -149,11 +149,11 @@ } if ($total + strlen($path) > 6000) { // %s won't pass through the JSON correctly - // under Windows. This is probably because not only + // under Windows. This is probably because not only // does the JSON have quotation marks in the content, // but because there'll be a lot of escaping and // double escaping because the JSON also contains - // regular expressions. cslint supports passing the + // regular expressions. cslint supports passing the // settings JSON through base64-encoded to mitigate // this issue. $futures[] = new ExecFuture( diff --git a/src/lint/linter/ArcanistConduitLinter.php b/src/lint/linter/ArcanistConduitLinter.php --- a/src/lint/linter/ArcanistConduitLinter.php +++ b/src/lint/linter/ArcanistConduitLinter.php @@ -85,18 +85,17 @@ // customization directly. throw new ArcanistUsageException( 'ArcanistConduitLinter does not support client-side severity '. - 'customization.' - ); + 'customization.'); } public function getLintNameMap() { // See getLintSeverityMap for rationale. throw new ArcanistUsageException( - 'ArcanistConduitLinter does not support a name map.' - ); + 'ArcanistConduitLinter does not support a name map.'); } protected function canCustomizeLintSeverities() { return false; } + } diff --git a/src/lint/linter/ArcanistJSONLintLinter.php b/src/lint/linter/ArcanistJSONLintLinter.php --- a/src/lint/linter/ArcanistJSONLintLinter.php +++ b/src/lint/linter/ArcanistJSONLintLinter.php @@ -93,4 +93,5 @@ return $messages; } + } diff --git a/src/lint/linter/ArcanistLinter.php b/src/lint/linter/ArcanistLinter.php --- a/src/lint/linter/ArcanistLinter.php +++ b/src/lint/linter/ArcanistLinter.php @@ -4,7 +4,6 @@ * Implements lint rules, like syntax checks for a specific language. * * @task info Human Readable Information - * * @stable */ abstract class ArcanistLinter { diff --git a/src/lint/linter/ArcanistMergeConflictLinter.php b/src/lint/linter/ArcanistMergeConflictLinter.php --- a/src/lint/linter/ArcanistMergeConflictLinter.php +++ b/src/lint/linter/ArcanistMergeConflictLinter.php @@ -50,4 +50,5 @@ self::LINT_MERGECONFLICT => pht('Unresolved merge conflict'), ); } + } diff --git a/src/lint/linter/ArcanistPhpcsLinter.php b/src/lint/linter/ArcanistPhpcsLinter.php --- a/src/lint/linter/ArcanistPhpcsLinter.php +++ b/src/lint/linter/ArcanistPhpcsLinter.php @@ -2,8 +2,6 @@ /** * Uses "PHP_CodeSniffer" to detect checkstyle errors in PHP code. - * - * @group linter */ final class ArcanistPhpcsLinter extends ArcanistExternalLinter { diff --git a/src/lint/linter/ArcanistPuppetLintLinter.php b/src/lint/linter/ArcanistPuppetLintLinter.php --- a/src/lint/linter/ArcanistPuppetLintLinter.php +++ b/src/lint/linter/ArcanistPuppetLintLinter.php @@ -103,4 +103,5 @@ return $messages; } + } diff --git a/src/lint/linter/ArcanistPyLintLinter.php b/src/lint/linter/ArcanistPyLintLinter.php --- a/src/lint/linter/ArcanistPyLintLinter.php +++ b/src/lint/linter/ArcanistPyLintLinter.php @@ -48,20 +48,18 @@ * (E) error, for probable bugs in the code * (F) fatal, if an error occurred which prevented pylint from * doing further processing. - * - * @group linter */ final class ArcanistPyLintLinter extends ArcanistLinter { private function getMessageCodeSeverity($code) { $config = $this->getEngine()->getConfigurationManager(); - $error_regexp = - $config->getConfigFromAnySource('lint.pylint.codes.error'); - $warning_regexp = - $config->getConfigFromAnySource('lint.pylint.codes.warning'); - $advice_regexp = - $config->getConfigFromAnySource('lint.pylint.codes.advice'); + $error_regexp = $config->getConfigFromAnySource( + 'lint.pylint.codes.error'); + $warning_regexp = $config->getConfigFromAnySource( + 'lint.pylint.codes.warning'); + $advice_regexp = $config->getConfigFromAnySource( + 'lint.pylint.codes.advice'); if (!$error_regexp && !$warning_regexp && !$advice_regexp) { throw new ArcanistUsageException( diff --git a/src/lint/linter/ArcanistScriptAndRegexLinter.php b/src/lint/linter/ArcanistScriptAndRegexLinter.php --- a/src/lint/linter/ArcanistScriptAndRegexLinter.php +++ b/src/lint/linter/ArcanistScriptAndRegexLinter.php @@ -152,8 +152,6 @@ * @task linterinfo Linter Information * @task parse Parsing Output * @task config Validating Configuration - * - * @group linter */ final class ArcanistScriptAndRegexLinter extends ArcanistLinter { diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php --- a/src/lint/linter/ArcanistXHPASTLinter.php +++ b/src/lint/linter/ArcanistXHPASTLinter.php @@ -2084,7 +2084,7 @@ /** * preg_quote() takes two arguments, but the second one is optional because - * it is possible to use (), [] or {} as regular expression delimiters. If + * it is possible to use (), [] or {} as regular expression delimiters. If * you don't pass a second argument, you're probably going to get something * wrong. */ @@ -2248,7 +2248,7 @@ /** * Finds duplicate keys in array initializers, as in - * array(1 => 'anything', 1 => 'foo'). Since the first entry is ignored, + * array(1 => 'anything', 1 => 'foo'). Since the first entry is ignored, * this is almost certainly an error. */ private function lintDuplicateKeysInArray(XHPASTNode $root) { diff --git a/src/lint/linter/__tests__/ArcanistLinterTestCase.php b/src/lint/linter/__tests__/ArcanistLinterTestCase.php --- a/src/lint/linter/__tests__/ArcanistLinterTestCase.php +++ b/src/lint/linter/__tests__/ArcanistLinterTestCase.php @@ -195,4 +195,5 @@ $actual, 'File as patched by lint did not match the expected patched file.'); } + } diff --git a/src/lint/linter/xhpast/ArcanistXHPASTLintNamingHook.php b/src/lint/linter/xhpast/ArcanistXHPASTLintNamingHook.php --- a/src/lint/linter/xhpast/ArcanistXHPASTLintNamingHook.php +++ b/src/lint/linter/xhpast/ArcanistXHPASTLintNamingHook.php @@ -7,7 +7,6 @@ * @task override Overriding Symbol Name Lint Messages * @task util Name Utilities * @task internal Internals - * @group lint * @stable */ abstract class ArcanistXHPASTLintNamingHook { @@ -114,8 +113,8 @@ * @task util */ public static function stripPHPFunction($symbol) { - // Allow initial "__" for magic methods like __construct; we could also - // enumerate these explicitly. + // Allow initial "__" for magic methods like __construct; we could also + // enumerate these explicitly. return preg_replace('/^__/', '', $symbol); } diff --git a/src/lint/linter/xhpast/ArcanistXHPASTLintSwitchHook.php b/src/lint/linter/xhpast/ArcanistXHPASTLintSwitchHook.php --- a/src/lint/linter/xhpast/ArcanistXHPASTLintSwitchHook.php +++ b/src/lint/linter/xhpast/ArcanistXHPASTLintSwitchHook.php @@ -3,8 +3,6 @@ /** * You can extend this class and set `xhpast.switchhook` in your `.arclint` * to have an opportunity to override results for linting `switch` statements. - * - * @group lint */ abstract class ArcanistXHPASTLintSwitchHook { diff --git a/src/lint/linter/xhpast/__tests__/ArcanistXHPASTLintNamingHookTestCase.php b/src/lint/linter/xhpast/__tests__/ArcanistXHPASTLintNamingHookTestCase.php --- a/src/lint/linter/xhpast/__tests__/ArcanistXHPASTLintNamingHookTestCase.php +++ b/src/lint/linter/xhpast/__tests__/ArcanistXHPASTLintNamingHookTestCase.php @@ -2,8 +2,6 @@ /** * Test cases for @{class:ArcanistXHPASTLintNamingHook}. - * - * @group testcase */ final class ArcanistXHPASTLintNamingHookTestCase extends ArcanistTestCase { diff --git a/src/lint/renderer/ArcanistLintCheckstyleXMLRenderer.php b/src/lint/renderer/ArcanistLintCheckstyleXMLRenderer.php --- a/src/lint/renderer/ArcanistLintCheckstyleXMLRenderer.php +++ b/src/lint/renderer/ArcanistLintCheckstyleXMLRenderer.php @@ -2,8 +2,6 @@ /** * Shows lint messages to the user. - * - * @group lint */ final class ArcanistLintCheckstyleXMLRenderer extends ArcanistLintRenderer { @@ -53,4 +51,5 @@ $this->writer->endDocument(); return $this->writer->flush(); } + } diff --git a/src/lint/renderer/ArcanistLintConsoleRenderer.php b/src/lint/renderer/ArcanistLintConsoleRenderer.php --- a/src/lint/renderer/ArcanistLintConsoleRenderer.php +++ b/src/lint/renderer/ArcanistLintConsoleRenderer.php @@ -2,10 +2,9 @@ /** * Shows lint messages to the user. - * - * @group lint */ final class ArcanistLintConsoleRenderer extends ArcanistLintRenderer { + private $showAutofixPatches = false; public function setShowAutofixPatches($show_autofix_patches) { @@ -234,7 +233,8 @@ } public function renderOkayResult() { - return - phutil_console_format("** OKAY ** No lint warnings.\n"); + return phutil_console_format( + "** OKAY ** No lint warnings.\n"); } + } diff --git a/src/lint/renderer/ArcanistLintJSONRenderer.php b/src/lint/renderer/ArcanistLintJSONRenderer.php --- a/src/lint/renderer/ArcanistLintJSONRenderer.php +++ b/src/lint/renderer/ArcanistLintJSONRenderer.php @@ -2,10 +2,9 @@ /** * Shows lint messages to the user. - * - * @group lint */ final class ArcanistLintJSONRenderer extends ArcanistLintRenderer { + const LINES_OF_CONTEXT = 3; public function renderLintResult(ArcanistLintResult $result) { @@ -32,4 +31,5 @@ public function renderOkayResult() { return ''; } + } diff --git a/src/lint/renderer/ArcanistLintLikeCompilerRenderer.php b/src/lint/renderer/ArcanistLintLikeCompilerRenderer.php --- a/src/lint/renderer/ArcanistLintLikeCompilerRenderer.php +++ b/src/lint/renderer/ArcanistLintLikeCompilerRenderer.php @@ -2,10 +2,9 @@ /** * Shows lint messages to the user. - * - * @group lint */ final class ArcanistLintLikeCompilerRenderer extends ArcanistLintRenderer { + public function renderLintResult(ArcanistLintResult $result) { $lines = array(); $messages = $result->getMessages(); @@ -32,4 +31,5 @@ public function renderOkayResult() { return ''; } + } diff --git a/src/lint/renderer/ArcanistLintNoneRenderer.php b/src/lint/renderer/ArcanistLintNoneRenderer.php --- a/src/lint/renderer/ArcanistLintNoneRenderer.php +++ b/src/lint/renderer/ArcanistLintNoneRenderer.php @@ -1,8 +1,5 @@ getMessages(); $path = $result->getPath(); @@ -24,7 +23,8 @@ } public function renderOkayResult() { - return - phutil_console_format("** OKAY ** No lint warnings.\n"); + return phutil_console_format( + "** OKAY ** No lint warnings.\n"); } + } diff --git a/src/parser/ArcanistBaseCommitParser.php b/src/parser/ArcanistBaseCommitParser.php --- a/src/parser/ArcanistBaseCommitParser.php +++ b/src/parser/ArcanistBaseCommitParser.php @@ -91,7 +91,6 @@ * Handle resolving individual rules. */ private function resolveRule($rule, $source) { - // NOTE: Returning `null` from this method means "no match". // Returning `false` from this method means "stop current ruleset". diff --git a/src/parser/ArcanistBundle.php b/src/parser/ArcanistBundle.php --- a/src/parser/ArcanistBundle.php +++ b/src/parser/ArcanistBundle.php @@ -2,8 +2,6 @@ /** * Converts changesets between different formats. - * - * @group diff */ final class ArcanistBundle { @@ -108,7 +106,6 @@ } private function getEOL($patch_type) { - // NOTE: Git always generates "\n" line endings, even under Windows, and // 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 @@ -198,9 +195,7 @@ return $obj; } - private function __construct() { - - } + private function __construct() {} public function writeToDisk($path) { $changes = $this->getChanges(); @@ -260,7 +255,6 @@ } public function toUnifiedDiff() { - $eol = $this->getEOL('unified'); $result = array(); diff --git a/src/parser/ArcanistDiffParser.php b/src/parser/ArcanistDiffParser.php --- a/src/parser/ArcanistDiffParser.php +++ b/src/parser/ArcanistDiffParser.php @@ -2,8 +2,6 @@ /** * Parses diffs from a working copy. - * - * @group diff */ final class ArcanistDiffParser { @@ -453,7 +451,6 @@ } private function parseSVNPropertyChange($op, $prop) { - $old = array(); $new = array(); @@ -1378,7 +1375,6 @@ * Returns a parseable normal diff and a textual commit message. */ private function stripGitFormatPatch($diff) { - // We can parse this by splitting it into two pieces over and over again // along different section dividers: // diff --git a/src/parser/__tests__/ArcanistDiffParserTestCase.php b/src/parser/__tests__/ArcanistDiffParserTestCase.php --- a/src/parser/__tests__/ArcanistDiffParserTestCase.php +++ b/src/parser/__tests__/ArcanistDiffParserTestCase.php @@ -2,8 +2,6 @@ /** * Test cases for @{class:ArcanistDiffParser}. - * - * @group testcase */ final class ArcanistDiffParserTestCase extends ArcanistTestCase { diff --git a/src/parser/diff/ArcanistDiffChange.php b/src/parser/diff/ArcanistDiffChange.php --- a/src/parser/diff/ArcanistDiffChange.php +++ b/src/parser/diff/ArcanistDiffChange.php @@ -2,8 +2,6 @@ /** * Represents a change to an individual path. - * - * @group diff */ final class ArcanistDiffChange { diff --git a/src/parser/diff/ArcanistDiffChangeType.php b/src/parser/diff/ArcanistDiffChangeType.php --- a/src/parser/diff/ArcanistDiffChangeType.php +++ b/src/parser/diff/ArcanistDiffChangeType.php @@ -2,10 +2,9 @@ /** * Defines constants for file types and operations in changesets. - * - * @group diff */ final class ArcanistDiffChangeType { + const TYPE_ADD = 1; const TYPE_CHANGE = 2; const TYPE_DELETE = 3; diff --git a/src/parser/diff/ArcanistDiffHunk.php b/src/parser/diff/ArcanistDiffHunk.php --- a/src/parser/diff/ArcanistDiffHunk.php +++ b/src/parser/diff/ArcanistDiffHunk.php @@ -2,8 +2,6 @@ /** * Represents a contiguous set of added and removed lines in a diff. - * - * @group diff */ final class ArcanistDiffHunk { diff --git a/src/repository/api/ArcanistGitAPI.php b/src/repository/api/ArcanistGitAPI.php --- a/src/repository/api/ArcanistGitAPI.php +++ b/src/repository/api/ArcanistGitAPI.php @@ -2,8 +2,6 @@ /** * Interfaces with Git working copies. - * - * @group workingcopy */ final class ArcanistGitAPI extends ArcanistRepositoryAPI { @@ -24,7 +22,6 @@ } protected function buildLocalFuture(array $argv) { - $argv[0] = 'git '.$argv[0]; $future = newv('ExecFuture', $argv); @@ -547,8 +544,8 @@ 'svn find-rev %s', $input); if (!$stdout) { - throw new ArcanistUsageException("Cannot find the {$vcs} equivalent " - ."of {$input}."); + throw new ArcanistUsageException( + "Cannot find the {$vcs} equivalent of {$input}."); } // When git performs a partial-rebuild during svn // look-up, we need to parse the final line @@ -834,7 +831,6 @@ } private function getFileDataAtRevision($path, $revision) { - // 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 // and treat it as though it as a file containing a list of other files, diff --git a/src/repository/api/ArcanistMercurialAPI.php b/src/repository/api/ArcanistMercurialAPI.php --- a/src/repository/api/ArcanistMercurialAPI.php +++ b/src/repository/api/ArcanistMercurialAPI.php @@ -2,8 +2,6 @@ /** * Interfaces with the Mercurial working copies. - * - * @group workingcopy */ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI { @@ -15,7 +13,6 @@ private $supportsPhases; protected function buildLocalFuture(array $argv) { - // Mercurial has a "defaults" feature which basically breaks automation by // allowing the user to add random flags to any command. This feature is // "deprecated" and "a bad idea" that you should "forget ... existed" @@ -82,8 +79,8 @@ '{node}', $string); if (!$stdout) { - throw new ArcanistUsageException("Cannot find the HG equivalent " - ."of {$revision_id} given."); + throw new ArcanistUsageException( + "Cannot find the HG equivalent of {$revision_id} given."); } return $stdout; } @@ -94,8 +91,8 @@ list($stdout) = $this->execxLocal( 'log -r %s --template {svnrev}', $hash); if (!$stdout) { - throw new ArcanistUsageException("Cannot find the SVN equivalent " - ."of {$hash} given."); + throw new ArcanistUsageException( + "Cannot find the SVN equivalent of {$hash} given."); } return $stdout; } @@ -128,13 +125,14 @@ hgsprintf('ancestor(%R,.)', $symbolic_commit)); } catch (Exception $ex) { throw new ArcanistUsageException( - "Commit '{$symbolic_commit}' is not a valid Mercurial commit ". - "identifier."); + "Commit '{$symbolic_commit}' is not a valid Mercurial commit ". + "identifier."); } } - $this->setBaseCommitExplanation('it is the greatest common ancestor of '. - 'the working directory and the commit you specified explicitly.'); + $this->setBaseCommitExplanation( + 'it is the greatest common ancestor of the working directory '. + 'and the commit you specified explicitly.'); return $commit; } @@ -161,7 +159,7 @@ } else { list($err, $stdout) = $this->execManualLocal( 'outgoing --branch %s --style default', - $this->getBranchName()); + $this->getBranchName()); } if (!$err) { @@ -464,7 +462,7 @@ private function getBulkFileDataAtRevision($paths, $revision) { // Calling 'hg cat' on each file individually is slow (1 second per file // on a large repo) because mercurial has to decompress and parse the - // entire manifest every time. Do it in one large batch instead. + // entire manifest every time. Do it in one large batch instead. // hg cat will write the file data to files in a temp directory $tmpdir = Filesystem::createTemporaryDirectory(); @@ -731,10 +729,10 @@ } /** - * Parse the Mercurial author field + * Parse the Mercurial author field. * * 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 * @return array @@ -762,9 +760,7 @@ public function doCommit($message) { $tmp_file = new TempFile(); Filesystem::writeFile($tmp_file, $message); - $this->execxLocal( - 'commit -l %s', - $tmp_file); + $this->execxLocal('commit -l %s', $tmp_file); $this->reloadWorkingCopy(); } diff --git a/src/repository/api/ArcanistRepositoryAPI.php b/src/repository/api/ArcanistRepositoryAPI.php --- a/src/repository/api/ArcanistRepositoryAPI.php +++ b/src/repository/api/ArcanistRepositoryAPI.php @@ -4,7 +4,6 @@ * Interfaces with the VCS in the working copy. * * @task status Path Status - * @group workingcopy */ abstract class ArcanistRepositoryAPI { diff --git a/src/repository/api/ArcanistSubversionAPI.php b/src/repository/api/ArcanistSubversionAPI.php --- a/src/repository/api/ArcanistSubversionAPI.php +++ b/src/repository/api/ArcanistSubversionAPI.php @@ -2,8 +2,6 @@ /** * Interfaces with Subversion working copies. - * - * @group workingcopy */ final class ArcanistSubversionAPI extends ArcanistRepositoryAPI { @@ -25,7 +23,7 @@ static $svn_dir = null; if ($svn_dir === null) { // from svn 1.7, subversion keeps a single .svn directly under - // the working copy root. However, we allow .arcconfigs that + // the working copy root. However, we allow .arcconfigs that // aren't at the working copy root. foreach (Filesystem::walkToRoot($this->getPath()) as $parent) { $possible_svn_dir = Filesystem::resolvePath('.svn', $parent); @@ -316,7 +314,6 @@ } public function getSVNInfo($path) { - if (empty($this->svnInfo[$path])) { if (empty($this->svnInfoRaw[$path])) { diff --git a/src/repository/api/__tests__/ArcanistRepositoryAPIStateTestCase.php b/src/repository/api/__tests__/ArcanistRepositoryAPIStateTestCase.php --- a/src/repository/api/__tests__/ArcanistRepositoryAPIStateTestCase.php +++ b/src/repository/api/__tests__/ArcanistRepositoryAPIStateTestCase.php @@ -120,5 +120,4 @@ } } - } diff --git a/src/repository/hookapi/ArcanistHookAPI.php b/src/repository/hookapi/ArcanistHookAPI.php --- a/src/repository/hookapi/ArcanistHookAPI.php +++ b/src/repository/hookapi/ArcanistHookAPI.php @@ -1,7 +1,7 @@ root."/$path"); return ($err ? null : $file); } + } diff --git a/src/repository/parser/ArcanistMercurialParser.php b/src/repository/parser/ArcanistMercurialParser.php --- a/src/repository/parser/ArcanistMercurialParser.php +++ b/src/repository/parser/ArcanistMercurialParser.php @@ -5,7 +5,6 @@ * provides low-level APIs for reading "hg" output. * * @task parse Parsing "hg" Output - * @group workingcopy */ final class ArcanistMercurialParser { diff --git a/src/repository/parser/__tests__/ArcanistMercurialParserTestCase.php b/src/repository/parser/__tests__/ArcanistMercurialParserTestCase.php --- a/src/repository/parser/__tests__/ArcanistMercurialParserTestCase.php +++ b/src/repository/parser/__tests__/ArcanistMercurialParserTestCase.php @@ -85,4 +85,5 @@ throw new Exception("No test information for test data '{$name}'!"); } } + } diff --git a/src/unit/ArcanistUnitTestResult.php b/src/unit/ArcanistUnitTestResult.php --- a/src/unit/ArcanistUnitTestResult.php +++ b/src/unit/ArcanistUnitTestResult.php @@ -2,8 +2,6 @@ /** * Represents the outcome of running a unit test. - * - * @group unit */ final class ArcanistUnitTestResult { @@ -78,8 +76,8 @@ } /** - * "extra data" allows an implementation to store additional - * key/value metadata along with the result of the test run. + * "extra data" allows an implementation to store additional key/value + * metadata along with the result of the test run. */ public function setExtraData(array $extra_data = null) { $this->extraData = $extra_data; diff --git a/src/unit/engine/ArcanistBaseTestResultParser.php b/src/unit/engine/ArcanistBaseTestResultParser.php --- a/src/unit/engine/ArcanistBaseTestResultParser.php +++ b/src/unit/engine/ArcanistBaseTestResultParser.php @@ -1,7 +1,7 @@ enableCoverage = $enable_coverage; - return $this; } public function setProjectRoot($project_root) { $this->projectRoot = $project_root; - return $this; } public function setCoverageFile($coverage_file) { $this->coverageFile = $coverage_file; - return $this; } public function setAffectedTests($affected_tests) { $this->affectedTests = $affected_tests; - return $this; } @@ -49,4 +45,5 @@ * @return array ArcanistUnitTestResult */ abstract public function parseTestResults($path, $test_results); + } diff --git a/src/unit/engine/ArcanistBaseUnitTestEngine.php b/src/unit/engine/ArcanistBaseUnitTestEngine.php --- a/src/unit/engine/ArcanistBaseUnitTestEngine.php +++ b/src/unit/engine/ArcanistBaseUnitTestEngine.php @@ -2,8 +2,6 @@ /** * Manages unit test execution. - * - * @group unit */ abstract class ArcanistBaseUnitTestEngine { @@ -105,12 +103,13 @@ abstract public function run(); /** - * Modify the return value of this function in the child class, if - * you do not need to echo the test results after all the tests have - * been run. This is the case for example when the child class - * prints the tests results while the tests are running. + * Modify the return value of this function in the child class, if you do + * not need to echo the test results after all the tests have been run. This + * is the case for example when the child class prints the tests results + * while the tests are running. */ public function shouldEchoTestResults() { return true; } + } diff --git a/src/unit/engine/ArcanistXUnitTestResultParser.php b/src/unit/engine/ArcanistXUnitTestResultParser.php --- a/src/unit/engine/ArcanistXUnitTestResultParser.php +++ b/src/unit/engine/ArcanistXUnitTestResultParser.php @@ -2,14 +2,12 @@ /** * Parser for JUnit, NUnit, etc results format - https://gist.github.com/959290 - * - * @group unitrun */ final class ArcanistXUnitTestResultParser { /** * Parse test results from provided input and return an array - * of ArcanistUnitTestResult + * of @{class:ArcanistUnitTestResult}. * * @param string $test_results String containing test results * @@ -42,7 +40,7 @@ $user_data = ''; // 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'); if ($skipped->length > 0) { $status = ArcanistUnitTestResult::RESULT_SKIP; @@ -55,7 +53,7 @@ } // 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'); if ($failures->length > 0) { $status = ArcanistUnitTestResult::RESULT_FAIL; @@ -68,8 +66,7 @@ } // An errored test is one that had an unanticipated problem. e.g., an - // unchecked throwable, or a problem with an implementation of the - // test. + // unchecked throwable, or a problem with an implementation of the test. $errors = $testcase->getElementsByTagName('error'); if ($errors->length > 0) { $status = ArcanistUnitTestResult::RESULT_BROKEN; diff --git a/src/unit/engine/CSharpToolsTestEngine.php b/src/unit/engine/CSharpToolsTestEngine.php --- a/src/unit/engine/CSharpToolsTestEngine.php +++ b/src/unit/engine/CSharpToolsTestEngine.php @@ -6,10 +6,7 @@ * 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 * code coverage data with a third-party tool. - * - * @group unitrun */ - final class CSharpToolsTestEngine extends XUnitTestEngine { private $cscoverHintPath; @@ -19,19 +16,17 @@ private $excludedFiles; /** - * Overridden version of `loadEnvironment` to support a different set - * of configuration values and to pull in the cstools config for - * code coverage. + * Overridden version of `loadEnvironment` to support a different set of + * configuration values and to pull in the cstools config for code coverage. */ protected function loadEnvironment() { - $config = $this->getConfigurationManager(); - $this->cscoverHintPath = - $config->getConfigFromAnySource('unit.csharp.cscover.binary'); - $this->matchRegex = - $config->getConfigFromAnySource('unit.csharp.coverage.match'); - $this->excludedFiles = - $config->getConfigFromAnySource('unit.csharp.coverage.excluded'); + $this->cscoverHintPath = $config->getConfigFromAnySource( + 'unit.csharp.cscover.binary'); + $this->matchRegex = $config->getConfigFromAnySource( + 'unit.csharp.coverage.match'); + $this->excludedFiles = $config->getConfigFromAnySource( + 'unit.csharp.coverage.excluded'); parent::loadEnvironment(); @@ -42,7 +37,7 @@ // Determine coverage path. if ($this->cscoverHintPath === null) { throw new Exception( - "Unable to locate cscover. Configure it with ". + "Unable to locate cscover. Configure it with ". "the `unit.csharp.coverage.binary' option in .arcconfig"); } $cscover = $this->projectRoot.DIRECTORY_SEPARATOR.$this->cscoverHintPath; @@ -50,15 +45,13 @@ $this->coverEngine = Filesystem::resolvePath($cscover); } else { throw new Exception( - 'Unable to locate cscover coverage runner '. - '(have you built yet?)'); + 'Unable to locate cscover coverage runner (have you built yet?)'); } - } /** * Returns whether the specified assembly should be instrumented for - * code coverage reporting. Checks the excluded file list and the + * code coverage reporting. Checks the excluded file list and the * matching regex if they are configured. * * @return boolean Whether the assembly should be instrumented. @@ -93,7 +86,7 @@ } // FIXME: Can't use TempFile here as xUnit doesn't like - // UNIX-style full paths. It sees the leading / as the + // UNIX-style full paths. It sees the leading / as the // start of an option flag, even when quoted. $xunit_temp = Filesystem::readRandomCharacters(10).'.results.xml'; if (file_exists($xunit_temp)) { @@ -158,7 +151,7 @@ } /** - * Retrieves the cached results for a coverage result file. The coverage + * Retrieves the cached results for a coverage result file. The coverage * result file is XML and can be large depending on what has been instrumented * so we cache it in case it's requested again. * @@ -189,7 +182,7 @@ } /** - * Processes a set of XML tags as code coverage results. We parse + * Processes a set of XML tags as code coverage results. We parse * the `instrumented` and `executed` tags with this method so that * we can access the data multiple times without a performance hit. * @@ -283,4 +276,5 @@ $this->addCachedResults($cover_file, $reports); return $reports; } + } diff --git a/src/unit/engine/GoTestResultParser.php b/src/unit/engine/GoTestResultParser.php --- a/src/unit/engine/GoTestResultParser.php +++ b/src/unit/engine/GoTestResultParser.php @@ -3,13 +3,7 @@ /** * Go Test Result Parsing utility * - * Intended to enable custom unit engines derived - * 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`) + * (To generate test output, run something like: `go test -v`) */ final class GoTestResultParser extends ArcanistBaseTestResultParser { @@ -23,7 +17,6 @@ * @return array */ public function parseTestResults($path, $test_results) { - $test_results = explode("\n", $test_results); $results = array(); @@ -137,4 +130,5 @@ return $test_case_results; } + } diff --git a/src/unit/engine/NoseTestEngine.php b/src/unit/engine/NoseTestEngine.php --- a/src/unit/engine/NoseTestEngine.php +++ b/src/unit/engine/NoseTestEngine.php @@ -4,13 +4,10 @@ * Very basic 'nose' unit test engine wrapper. * * Requires nose 1.1.3 for code coverage. - * - * @group unitrun */ final class NoseTestEngine extends ArcanistBaseUnitTestEngine { public function run() { - $paths = $this->getPaths(); $affected_tests = array(); @@ -52,9 +49,7 @@ $xunit_tmp = new TempFile(); $cover_tmp = new TempFile(); - $future = $this->buildTestFuture($test_path, - $xunit_tmp, - $cover_tmp); + $future = $this->buildTestFuture($test_path, $xunit_tmp, $cover_tmp); $futures[$test_path] = $future; $tmpfiles[$test_path] = array( @@ -91,9 +86,9 @@ $xunit_tmp); if ($this->getEnableCoverage() !== false) { - $cmd_line .= csprintf(' --with-coverage --cover-xml '. - '--cover-xml-file=%s', - $cover_tmp); + $cmd_line .= csprintf( + ' --with-coverage --cover-xml --cover-xml-file=%s', + $cover_tmp); } return new ExecFuture('%C %s', $cmd_line, $path); diff --git a/src/unit/engine/PhpunitResultParser.php b/src/unit/engine/PhpunitResultParser.php --- a/src/unit/engine/PhpunitResultParser.php +++ b/src/unit/engine/PhpunitResultParser.php @@ -3,13 +3,8 @@ /** * PHPUnit Result Parsing utility * - * Intended to enable custom unit engines derived - * from phpunit to reuse common business logic related - * to parsing phpunit test results and reports - * - * For an example on how to integrate with your test - * engine, see PhpunitTestEngine. - * + * For an example on how to integrate with your test engine, see + * @{class:PhpunitTestEngine}. */ final class PhpunitResultParser extends ArcanistBaseTestResultParser { @@ -22,7 +17,6 @@ * @return array */ public function parseTestResults($path, $test_results) { - if (!$test_results) { $result = id(new ArcanistUnitTestResult()) ->setName($path) @@ -163,7 +157,6 @@ * valid. * * @param string $json String containing JSON report - * * @return array JSON decoded array */ private function getJsonReport($json) { @@ -186,4 +179,5 @@ return $json; } + } diff --git a/src/unit/engine/PhpunitTestEngine.php b/src/unit/engine/PhpunitTestEngine.php --- a/src/unit/engine/PhpunitTestEngine.php +++ b/src/unit/engine/PhpunitTestEngine.php @@ -1,15 +1,7 @@ projectRoot = $this->getWorkingCopy()->getProjectRoot(); $this->affectedTests = array(); foreach ($this->getPaths() as $path) { @@ -79,8 +70,6 @@ 'json' => $json_tmp, 'clover' => $clover_tmp, ); - - } $results = array(); @@ -99,7 +88,7 @@ } /** - * Parse test results from phpunit json report + * Parse test results from phpunit json report. * * @param string $path Path to test * @param string $json_tmp Path to phpunit json report @@ -257,8 +246,8 @@ } /** - * Tries to find and update phpunit configuration file - * based on phpunit_config option in .arcconfig + * Tries to find and update phpunit configuration file based on + * `phpunit_config` option in `.arcconfig`. */ private function prepareConfigFile() { $project_root = $this->projectRoot.DIRECTORY_SEPARATOR; @@ -284,4 +273,5 @@ } } } + } diff --git a/src/unit/engine/PhutilUnitTestEngine.php b/src/unit/engine/PhutilUnitTestEngine.php --- a/src/unit/engine/PhutilUnitTestEngine.php +++ b/src/unit/engine/PhutilUnitTestEngine.php @@ -2,8 +2,6 @@ /** * Very basic unit test engine which runs libphutil tests. - * - * @group unitrun */ final class PhutilUnitTestEngine extends ArcanistBaseUnitTestEngine { diff --git a/src/unit/engine/PytestTestEngine.php b/src/unit/engine/PytestTestEngine.php --- a/src/unit/engine/PytestTestEngine.php +++ b/src/unit/engine/PytestTestEngine.php @@ -2,8 +2,6 @@ /** * Very basic 'py.test' unit test engine wrapper. - * - * @group unitrun */ final class PytestTestEngine extends ArcanistBaseUnitTestEngine { @@ -27,12 +25,13 @@ public function buildTestFuture($junit_tmp, $cover_tmp) { $paths = $this->getPaths(); - $cmd_line = csprintf('py.test --junitxml %s', - $junit_tmp); + $cmd_line = csprintf('py.test --junitxml %s', $junit_tmp); - if ($this->getEnableCoverage() !== false) { - $cmd_line = csprintf('coverage run --source %s -m %C', - $this->project_root, $cmd_line); + if ($this->getEnableCoverage() !== false) { + $cmd_line = csprintf( + 'coverage run --source %s -m %C', + $this->project_root, + $cmd_line); } return new ExecFuture('%C', $cmd_line); @@ -132,4 +131,5 @@ return $reports; } + } diff --git a/src/unit/engine/XUnitTestEngine.php b/src/unit/engine/XUnitTestEngine.php --- a/src/unit/engine/XUnitTestEngine.php +++ b/src/unit/engine/XUnitTestEngine.php @@ -7,7 +7,6 @@ * that the test assembly that verifies the functionality of `SomeAssembly` is * located at `SomeAssembly.Tests`. * - * @group unitrun * @concrete-extensible */ class XUnitTestEngine extends ArcanistBaseUnitTestEngine { @@ -27,10 +26,10 @@ } /** - * Determines what executables and test paths to use. Between platforms - * this also changes whether the test engine is run under .NET or Mono. It - * also ensures that all of the required binaries are available for the tests - * to run successfully. + * Determines what executables and test paths to use. Between platforms this + * also changes whether the test engine is run under .NET or Mono. It also + * ensures that all of the required binaries are available for the tests to + * run successfully. * * @return void */ @@ -78,14 +77,14 @@ $this->testEngine = 'xunit.console.clr4.exe'; } else { throw new Exception( - "Unable to locate xUnit console runner. Configure ". + "Unable to locate xUnit console runner. Configure ". "it with the `unit.csharp.xunit.binary' option in .arcconfig"); } } /** - * Main entry point for the test engine. Determines what assemblies to - * build and test based on the files that have changed. + * Main entry point for the test engine. Determines what assemblies to build + * and test based on the files that have changed. * * @return array Array of test results. */ @@ -137,7 +136,8 @@ if (!$exists) { $results[] = array( 'project' => $project, - 'assembly' => $assembly); + 'assembly' => $assembly, + ); } } } @@ -192,7 +192,7 @@ /** * If the `Build` directory exists, we assume that this is a multi-platform - * project that requires generation of C# project files. Because we want to + * project that requires generation of C# project files. Because we want to * test that the generation and subsequent build is whole, we need to * regenerate any projects in case the developer has added files through an * IDE and then forgotten to add them to the respective `.definitions` file. @@ -202,7 +202,6 @@ * @return array Array of test results. */ private function generateProjects() { - // No "Build" directory; so skip generation of projects. if (!is_dir(Filesystem::resolvePath($this->projectRoot.'/Build'))) { return array(); @@ -255,7 +254,7 @@ /** * Build the projects relevant for the specified test assemblies and return - * the results of the builds as test results. This build also passes the + * the results of the builds as test results. This build also passes the * "SkipTestsOnBuild" parameter when building the projects, so that MSBuild * conditionals can be used to prevent any tests running as part of the * build itself (since the unit tester is about to run each of the tests @@ -302,9 +301,8 @@ } /** - * Build the future for running a unit test. This can be - * overridden to enable support for code coverage via - * another tool + * Build the future for running a unit test. This can be overridden to enable + * support for code coverage via another tool. * * @param string Name of the test assembly. * @return array The future, output filename and coverage filename @@ -312,7 +310,7 @@ */ protected function buildTestFuture($test_assembly) { // FIXME: Can't use TempFile here as xUnit doesn't like - // UNIX-style full paths. It sees the leading / as the + // UNIX-style full paths. It sees the leading / as the // start of an option flag, even when quoted. $xunit_temp = Filesystem::readRandomCharacters(10).'.results.xml'; if (file_exists($xunit_temp)) { @@ -340,7 +338,6 @@ * @return array Array of test results. */ private function testAssemblies(array $test_assemblies) { - $results = array(); // Build the futures for running the tests. @@ -368,13 +365,12 @@ } else { // FIXME: There's a bug in Mono which causes a segmentation fault // when xUnit.NET runs; this causes the XML file to not appear - // (depending on when the segmentation fault occurs). See + // (depending on when the segmentation fault occurs). See // https://bugzilla.xamarin.com/show_bug.cgi?id=16379 // for more information. // Since it's not possible for the user to correct this error, we // ignore the fact the tests didn't run here. - // } } @@ -383,8 +379,8 @@ /** * Returns null for this implementation as xUnit does not support code - * coverage directly. Override this method in another class to provide - * code coverage information (also see `CSharpToolsUnitEngine`). + * coverage directly. Override this method in another class to provide code + * coverage information (also see @{class:CSharpToolsUnitEngine}). * * @param string The name of the coverage file if one was provided by * `buildTestFuture`. @@ -399,7 +395,7 @@ * * @param string The name of the xUnit results file. * @param string The name of the coverage file if one was provided by - * `buildTestFuture`. This is passed through to + * `buildTestFuture`. This is passed through to * `parseCoverageResult`. * @return array Test results. */ diff --git a/src/unit/engine/__tests__/GoTestResultParserTestCase.php b/src/unit/engine/__tests__/GoTestResultParserTestCase.php --- a/src/unit/engine/__tests__/GoTestResultParserTestCase.php +++ b/src/unit/engine/__tests__/GoTestResultParserTestCase.php @@ -2,11 +2,6 @@ /** * Test for @{class:GoTestResultParser}. - * - * (putting tests in your tests so you can test - * while you test) - * - * @group testcase */ final class GoTestResultParserTestCase extends ArcanistTestCase { @@ -107,4 +102,5 @@ $result->getResult()); } } + } diff --git a/src/unit/engine/__tests__/PHPUnitTestEngineTestCase.php b/src/unit/engine/__tests__/PHPUnitTestEngineTestCase.php --- a/src/unit/engine/__tests__/PHPUnitTestEngineTestCase.php +++ b/src/unit/engine/__tests__/PHPUnitTestEngineTestCase.php @@ -2,13 +2,10 @@ /** * Tests for @{class:PHPUnitTestEngine}. - * - * @group testcase */ final class PHPUnitTestEngineTestCase extends ArcanistTestCase { public function testSearchLocations() { - $path = '/path/to/some/file/X.php'; $this->assertEqual( diff --git a/src/unit/engine/__tests__/PhutilUnitTestEngineTestCase.php b/src/unit/engine/__tests__/PhutilUnitTestEngineTestCase.php --- a/src/unit/engine/__tests__/PhutilUnitTestEngineTestCase.php +++ b/src/unit/engine/__tests__/PhutilUnitTestEngineTestCase.php @@ -2,8 +2,6 @@ /** * Very meta test for @{class:PhutilUnitTestEngine}. - * - * @group testcase */ final class PhutilUnitTestEngineTestCase extends ArcanistTestCase { diff --git a/src/unit/engine/__tests__/XUnitTestResultParserTestCase.php b/src/unit/engine/__tests__/XUnitTestResultParserTestCase.php --- a/src/unit/engine/__tests__/XUnitTestResultParserTestCase.php +++ b/src/unit/engine/__tests__/XUnitTestResultParserTestCase.php @@ -2,11 +2,6 @@ /** * Test for @{class:ArcanistXUnitTestResultParser}. - * - * (putting tests in your tests so you can test - * while you test) - * - * @group testcase */ final class XUnitTestResultParserTestCase extends ArcanistTestCase { diff --git a/src/unit/engine/phutil/ArcanistPhutilTestCase.php b/src/unit/engine/phutil/ArcanistPhutilTestCase.php --- a/src/unit/engine/phutil/ArcanistPhutilTestCase.php +++ b/src/unit/engine/phutil/ArcanistPhutilTestCase.php @@ -388,9 +388,7 @@ * * @task internal */ - final public function __construct() { - - } + final public function __construct() {} /** diff --git a/src/unit/engine/phutil/testcase/ArcanistPhutilTestCaseTestCase.php b/src/unit/engine/phutil/testcase/ArcanistPhutilTestCaseTestCase.php --- a/src/unit/engine/phutil/testcase/ArcanistPhutilTestCaseTestCase.php +++ b/src/unit/engine/phutil/testcase/ArcanistPhutilTestCaseTestCase.php @@ -2,8 +2,6 @@ /** * Test for @{class:PhutilUnitTestEngineTestCase}. - * - * @group testcase */ final class ArcanistPhutilTestCaseTestCase extends ArcanistPhutilTestCase { diff --git a/src/unit/engine/phutil/testcase/ArcanistPhutilTestSkippedException.php b/src/unit/engine/phutil/testcase/ArcanistPhutilTestSkippedException.php --- a/src/unit/engine/phutil/testcase/ArcanistPhutilTestSkippedException.php +++ b/src/unit/engine/phutil/testcase/ArcanistPhutilTestSkippedException.php @@ -2,7 +2,5 @@ /** * Thrown to skip test execution. - * - * @group unitrun */ final class ArcanistPhutilTestSkippedException extends Exception {} diff --git a/src/unit/engine/phutil/testcase/ArcanistPhutilTestTerminatedException.php b/src/unit/engine/phutil/testcase/ArcanistPhutilTestTerminatedException.php --- a/src/unit/engine/phutil/testcase/ArcanistPhutilTestTerminatedException.php +++ b/src/unit/engine/phutil/testcase/ArcanistPhutilTestTerminatedException.php @@ -2,7 +2,5 @@ /** * Thrown to prematurely end test execution. - * - * @group unitrun */ final class ArcanistPhutilTestTerminatedException extends Exception {} diff --git a/src/unit/renderer/ArcanistUnitConsoleRenderer.php b/src/unit/renderer/ArcanistUnitConsoleRenderer.php --- a/src/unit/renderer/ArcanistUnitConsoleRenderer.php +++ b/src/unit/renderer/ArcanistUnitConsoleRenderer.php @@ -1,8 +1,5 @@ getConduit(); $revisions = $conduit->callMethodSynchronous( @@ -81,8 +83,10 @@ 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) { $result = $this->getConduit()->callMethodSynchronous( 'diffusion.getcommits', @@ -97,15 +101,18 @@ return $commit; } - // Retrieves default template from differential and prefills info + /** + * Retrieves default template from differential and pre-fills info. + */ private function buildCommitMessage($commit_hash) { $conduit = $this->getConduit(); $repository_api = $this->getRepositoryAPI(); $summary = $repository_api->getBackoutMessage($commit_hash); - $fields = array('summary' => $summary, - 'testPlan' => 'revert-hammer', - ); + $fields = array( + 'summary' => $summary, + 'testPlan' => 'revert-hammer', + ); $template = $conduit->callMethodSynchronous( 'differential.getcommitmessage', array( @@ -119,7 +126,9 @@ 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() { $console = PhutilConsole::getConsole(); $conduit = $this->getConduit(); @@ -128,7 +137,7 @@ $is_git_svn = $repository_api instanceof ArcanistGitAPI && $repository_api->isGitSubversionRepo(); $is_hg_svn = $repository_api instanceof ArcanistMercurialAPI && - $repository_api->isHgSubversionRepo(); + $repository_api->isHgSubversionRepo(); $revision_id = null; if (!($repository_api instanceof ArcanistGitAPI) && @@ -163,8 +172,8 @@ $commit_hash = $input[0]; } if (!$repository_api->hasLocalCommit($commit_hash)) { - throw new ArcanistUsageException('Invalid commit provided or does not'. - 'exist in the working copy!'); + throw new ArcanistUsageException( + 'Invalid commit provided or does not exist in the working copy!'); } // Run 'backout'. @@ -177,6 +186,6 @@ $message = $this->buildCommitMessage($commit_hash); $repository_api->doCommit($message); $console->writeOut("Double-check the commit and push when ready\n"); - } + } diff --git a/src/workflow/ArcanistBaseWorkflow.php b/src/workflow/ArcanistBaseWorkflow.php --- a/src/workflow/ArcanistBaseWorkflow.php +++ b/src/workflow/ArcanistBaseWorkflow.php @@ -76,9 +76,7 @@ private $changeCache = array(); - public function __construct() { - - } + public function __construct() {} abstract public function run(); @@ -320,12 +318,14 @@ } if (empty($credentials['user'])) { - throw new ConduitClientException('ERR-INVALID-USER', - 'Empty user in credentials.'); + throw new ConduitClientException( + 'ERR-INVALID-USER', + 'Empty user in credentials.'); } if (empty($credentials['certificate'])) { - throw new ConduitClientException('ERR-NO-CERTIFICATE', - 'Empty certificate in credentials.'); + throw new ConduitClientException( + 'ERR-NO-CERTIFICATE', + 'Empty certificate in credentials.'); } $description = idx($credentials, 'description', ''); diff --git a/src/workflow/ArcanistBookmarkWorkflow.php b/src/workflow/ArcanistBookmarkWorkflow.php --- a/src/workflow/ArcanistBookmarkWorkflow.php +++ b/src/workflow/ArcanistBookmarkWorkflow.php @@ -1,9 +1,7 @@ array( 'param' => 'status', 'short' => 's', - 'help' => pht('Specify a new status. Valid status options can be '. - 'seen with the `list-statuses` argument.'), + 'help' => pht( + 'Specify a new status. Valid status options can be '. + 'seen with the `list-statuses` argument.'), ), 'list-statuses' => array( 'help' => 'Show available status options and exit.', diff --git a/src/workflow/ArcanistCommitWorkflow.php b/src/workflow/ArcanistCommitWorkflow.php --- a/src/workflow/ArcanistCommitWorkflow.php +++ b/src/workflow/ArcanistCommitWorkflow.php @@ -2,8 +2,6 @@ /** * Executes "svn commit" once a revision has been "Accepted". - * - * @group workflow */ final class ArcanistCommitWorkflow extends ArcanistBaseWorkflow { @@ -336,5 +334,4 @@ } } - } diff --git a/src/workflow/ArcanistCoverWorkflow.php b/src/workflow/ArcanistCoverWorkflow.php --- a/src/workflow/ArcanistCoverWorkflow.php +++ b/src/workflow/ArcanistCoverWorkflow.php @@ -2,8 +2,6 @@ /** * Covers your professional reputation by blaming changes to locate reviewers. - * - * @group workflow */ final class ArcanistCoverWorkflow extends ArcanistBaseWorkflow { @@ -63,7 +61,6 @@ } public function run() { - $repository_api = $this->getRepositoryAPI(); $in_paths = $this->getArgument('paths'); diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -7,8 +7,6 @@ * @task message Commit and Update Messages * @task diffspec Diff Specification * @task diffprop Diff Properties - * - * @group workflow */ final class ArcanistDiffWorkflow extends ArcanistBaseWorkflow { diff --git a/src/workflow/ArcanistDownloadWorkflow.php b/src/workflow/ArcanistDownloadWorkflow.php --- a/src/workflow/ArcanistDownloadWorkflow.php +++ b/src/workflow/ArcanistDownloadWorkflow.php @@ -2,8 +2,6 @@ /** * Download a file from Phabricator. - * - * @group workflow */ final class ArcanistDownloadWorkflow extends ArcanistBaseWorkflow { @@ -36,8 +34,9 @@ return array( 'show' => array( 'conflicts' => array( - 'as' => 'Use --show to direct the file to stdout, or --as to direct '. - 'it to a named location.', + 'as' => + 'Use --show to direct the file to stdout, or --as to direct '. + 'it to a named location.', ), 'help' => 'Write file to stdout instead of to disk.', ), diff --git a/src/workflow/ArcanistExportWorkflow.php b/src/workflow/ArcanistExportWorkflow.php --- a/src/workflow/ArcanistExportWorkflow.php +++ b/src/workflow/ArcanistExportWorkflow.php @@ -2,8 +2,6 @@ /** * Exports changes from Differential or the working copy to a file. - * - * @group workflow */ final class ArcanistExportWorkflow extends ArcanistBaseWorkflow { @@ -84,7 +82,6 @@ ); } - protected function didParseArguments() { $source = self::SOURCE_LOCAL; $requested = 0; @@ -105,11 +102,10 @@ if ($requested > 1) { throw new ArcanistUsageException( - "Options '--revision' and '--diff' are not compatible. Choose exactly ". - "one change source."); + "Options '--revision' and '--diff' are not compatible. Choose exactly ". + "one change source."); } - $format = null; $requested = 0; if ($this->getArgument('git')) { @@ -167,7 +163,6 @@ } public function run() { - $source = $this->getSource(); switch ($source) { @@ -218,7 +213,7 @@ $bundle->setProjectID($this->getWorkingCopy()->getProjectID()); $bundle->setBaseRevision( $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); $bundle->setAuthorName($parser->getDisplayName()); @@ -273,4 +268,5 @@ return 0; } + } diff --git a/src/workflow/ArcanistFeatureWorkflow.php b/src/workflow/ArcanistFeatureWorkflow.php --- a/src/workflow/ArcanistFeatureWorkflow.php +++ b/src/workflow/ArcanistFeatureWorkflow.php @@ -1,9 +1,8 @@ 'objects', 'clear' => array( - 'help' => 'Delete the flag on an object.' + 'help' => 'Delete the flag on an object.', ), 'edit' => array( - 'help' => 'Edit the flag on an object.' + 'help' => 'Edit the flag on an object.', ), 'color' => array( 'param' => 'color', - 'help' => 'Set the color of a flag.' + 'help' => 'Set the color of a flag.', ), 'note' => array( 'param' => 'note', - 'help' => 'Set the note on a flag.' + 'help' => 'Set the note on a flag.', ), ); } diff --git a/src/workflow/ArcanistGitHookPreReceiveWorkflow.php b/src/workflow/ArcanistGitHookPreReceiveWorkflow.php --- a/src/workflow/ArcanistGitHookPreReceiveWorkflow.php +++ b/src/workflow/ArcanistGitHookPreReceiveWorkflow.php @@ -2,8 +2,6 @@ /** * Installable as a git pre-receive hook. - * - * @group workflow */ final class ArcanistGitHookPreReceiveWorkflow extends ArcanistBaseWorkflow { @@ -119,4 +117,5 @@ return 0; } + } diff --git a/src/workflow/ArcanistHelpWorkflow.php b/src/workflow/ArcanistHelpWorkflow.php --- a/src/workflow/ArcanistHelpWorkflow.php +++ b/src/workflow/ArcanistHelpWorkflow.php @@ -2,8 +2,6 @@ /** * Seduces the reader with majestic prose. - * - * @group workflow */ final class ArcanistHelpWorkflow extends ArcanistBaseWorkflow { diff --git a/src/workflow/ArcanistInlinesWorkflow.php b/src/workflow/ArcanistInlinesWorkflow.php --- a/src/workflow/ArcanistInlinesWorkflow.php +++ b/src/workflow/ArcanistInlinesWorkflow.php @@ -1,8 +1,5 @@ determineConduitURI(); $this->setConduitURI($uri); $configuration_manager = $this->getConfigurationManager(); diff --git a/src/workflow/ArcanistLandWorkflow.php b/src/workflow/ArcanistLandWorkflow.php --- a/src/workflow/ArcanistLandWorkflow.php +++ b/src/workflow/ArcanistLandWorkflow.php @@ -2,10 +2,9 @@ /** * Lands a branch by rebasing, merging and amending it. - * - * @group workflow */ final class ArcanistLandWorkflow extends ArcanistBaseWorkflow { + private $isGit; private $isGitSvn; private $isHg; @@ -81,29 +80,31 @@ return array( 'onto' => array( 'param' => 'master', - 'help' => pht('Land feature branch onto a branch other than the '. - 'default (\'master\' in git, \'default\' in hg). You '. - 'can change the default by setting '. - '\'arc.land.onto.default\' with `arc set-config` or '. - 'for the entire project in .arcconfig.'), + 'help' => pht( + "Land feature branch onto a branch other than the default ". + "('master' in git, 'default' in hg). You can change the default ". + "by setting 'arc.land.onto.default' with `arc set-config` or ". + "for the entire project in .arcconfig."), ), 'hold' => array( - 'help' => pht('Prepare the change to be pushed, but do not actually '. - 'push it.'), + 'help' => pht( + 'Prepare the change to be pushed, but do not actually push it.'), ), 'keep-branch' => array( - 'help' => pht('Keep the feature branch after pushing changes to the '. - 'remote (by default, it is deleted).'), + 'help' => pht( + 'Keep the feature branch after pushing changes to the '. + 'remote (by default, it is deleted).'), ), 'remote' => array( 'param' => 'origin', - 'help' => pht('Push to a remote other than the default (\'origin\' '. - 'in git).'), + 'help' => pht( + "Push to a remote other than the default ('origin' in git)."), ), 'merge' => array( - 'help' => pht('Perform a --no-ff merge, not a --squash merge. If the '. - 'project is marked as having an immutable history, '. - 'this is the default behavior.'), + 'help' => pht( + 'Perform a --no-ff merge, not a --squash merge. If the project '. + 'is marked as having an immutable history, this is the default '. + 'behavior.'), 'supports' => array( 'git', ), @@ -112,45 +113,45 @@ ), ), 'squash' => array( - 'help' => pht('Perform a --squash merge, not a --no-ff merge. If the '. - 'project is marked as having a mutable history, this '. - 'is the default behavior.'), + 'help' => pht( + 'Perform a --squash merge, not a --no-ff merge. If the project is '. + 'marked as having a mutable history, this is the default behavior.'), 'conflicts' => array( 'merge' => '--merge and --squash are conflicting merge strategies.', ), ), 'delete-remote' => array( - 'help' => pht('Delete the feature branch in the remote after '. - 'landing it.'), + 'help' => pht( + 'Delete the feature branch in the remote after landing it.'), 'conflicts' => array( 'keep-branch' => true, ), ), 'update-with-rebase' => array( - 'help' => pht('When updating the feature branch, use rebase '. - 'instead of merge. This might make things work '. - 'better in some cases. Set arc.land.update.default '. - 'to \'rebase\' to make this the default.'), + 'help' => pht( + "When updating the feature branch, use rebase instead of merge. ". + "This might make things work better in some cases. Set ". + "arc.land.update.default to 'rebase' to make this the default."), 'conflicts' => array( - 'merge' => pht('The --merge strategy does not update the feature '. - 'branch.'), - 'update-with-merge' => pht('Cannot be used with '. - '--update-with-merge.'), + 'merge' => pht( + 'The --merge strategy does not update the feature branch.'), + 'update-with-merge' => pht( + 'Cannot be used with --update-with-merge.'), ), 'supports' => array( 'git', ), ), 'update-with-merge' => array( - 'help' => pht('When updating the feature branch, use merge instead '. - 'of rebase. This is the default behavior. Setting '. - 'arc.land.update.default to \'merge\' can also be '. - 'used to make this the default.'), + 'help' => pht( + "When updating the feature branch, use merge instead of rebase. ". + "This is the default behavior. Setting arc.land.update.default to ". + "'merge' can also be used to make this the default."), 'conflicts' => array( - 'merge' => pht('The --merge strategy does not update the feature '. - 'branch.'), - 'update-with-rebase' => pht('Cannot be used with '. - '--update-with-rebase.'), + 'merge' => pht( + 'The --merge strategy does not update the feature branch.'), + 'update-with-rebase' => pht( + 'Cannot be used with --update-with-rebase.'), ), 'supports' => array( 'git', @@ -158,12 +159,14 @@ ), 'revision' => array( 'param' => 'id', - 'help' => pht('Use the message from a specific revision, rather than '. - 'inferring the revision based on branch content.'), + 'help' => pht( + 'Use the message from a specific revision, rather than '. + 'inferring the revision based on branch content.'), ), 'preview' => array( - 'help' => pht('Prints the commits that would be landed. Does not '. - 'actually modify or land the commits.'), + 'help' => pht( + 'Prints the commits that would be landed. Does not '. + 'actually modify or land the commits.'), ), '*' => 'branch', ); @@ -318,8 +321,9 @@ if ($this->useSquash) { if (!$repository_api->supportsRebase()) { throw new ArcanistUsageException( - pht('You must enable the rebase extension to use the --squash '. - 'strategy.')); + pht( + 'You must enable the rebase extension to use the --squash '. + 'strategy.')); } } @@ -613,7 +617,7 @@ } } - // Pull succeeded. Now make sure master is not on an outgoing change + // Pull succeeded. Now make sure master is not on an outgoing change if ($repository_api->supportsPhases()) { list($out) = $repository_api->execxLocal( 'log -r %s --template %s', $this->onto, '{phase}'); @@ -937,7 +941,9 @@ 'commit -F %s', $this->messageFile); if (phutil_is_windows()) { - // Occasionally on large repositories on Windows, Git can exit with an unclean working copy here. This prevents reverts from being pushed to the remote when this occurs. + // Occasionally on large repositories on Windows, Git can exit with + // an unclean working copy here. This prevents reverts from being + // pushed to the remote when this occurs. $this->requireCleanWorkingCopy(); } } else if ($this->isHg) { diff --git a/src/workflow/ArcanistLiberateWorkflow.php b/src/workflow/ArcanistLiberateWorkflow.php --- a/src/workflow/ArcanistLiberateWorkflow.php +++ b/src/workflow/ArcanistLiberateWorkflow.php @@ -3,13 +3,11 @@ /** * Create and update libphutil libraries. * - * This workflow is unusual and involves reexecuting 'arc liberate' as a - * subprocess with "--remap" and "--verify". This is because there is no way + * This workflow is unusual and involves re-executing 'arc liberate' as a + * subprocess with `--remap` and `--verify`. This is because there is no way * to unload or reload a library, so every process is stuck with the library * definition it had when it first loaded. This is normally fine, but - * problematic in this case because 'arc liberate' modifies library definitions. - * - * @group workflow + * problematic in this case because `arc liberate` modifies library definitions. */ final class ArcanistLiberateWorkflow extends ArcanistBaseWorkflow { diff --git a/src/workflow/ArcanistLintWorkflow.php b/src/workflow/ArcanistLintWorkflow.php --- a/src/workflow/ArcanistLintWorkflow.php +++ b/src/workflow/ArcanistLintWorkflow.php @@ -2,8 +2,6 @@ /** * Runs lint rules on changes. - * - * @group workflow */ final class ArcanistLintWorkflow extends ArcanistBaseWorkflow { @@ -63,7 +61,7 @@ return array( 'lintall' => array( 'help' => - 'Show all lint warnings, not just those on changed lines. When '. + 'Show all lint warnings, not just those on changed lines. When '. 'paths are specified, this is the default behavior.', 'conflicts' => array( 'only-changed' => true, @@ -71,8 +69,8 @@ ), 'only-changed' => array( 'help' => - 'Show lint warnings just on changed lines. When no paths are '. - 'specified, this is the default. This differs from only-new '. + 'Show lint warnings just on changed lines. When no paths are '. + 'specified, this is the default. This differs from only-new '. 'in cases where line modifications introduce lint on other '. 'unmodified lines.', 'conflicts' => array( diff --git a/src/workflow/ArcanistListWorkflow.php b/src/workflow/ArcanistListWorkflow.php --- a/src/workflow/ArcanistListWorkflow.php +++ b/src/workflow/ArcanistListWorkflow.php @@ -2,8 +2,6 @@ /** * Lists open revisions in Differential. - * - * @group workflow */ final class ArcanistListWorkflow extends ArcanistBaseWorkflow { @@ -104,4 +102,5 @@ $table->draw(); return 0; } + } diff --git a/src/workflow/ArcanistPasteWorkflow.php b/src/workflow/ArcanistPasteWorkflow.php --- a/src/workflow/ArcanistPasteWorkflow.php +++ b/src/workflow/ArcanistPasteWorkflow.php @@ -2,8 +2,6 @@ /** * Upload a chunk of text to the Paste application, or download one. - * - * @group workflow */ final class ArcanistPasteWorkflow extends ArcanistBaseWorkflow { diff --git a/src/workflow/ArcanistPatchWorkflow.php b/src/workflow/ArcanistPatchWorkflow.php --- a/src/workflow/ArcanistPatchWorkflow.php +++ b/src/workflow/ArcanistPatchWorkflow.php @@ -2,8 +2,6 @@ /** * Applies changes from Differential or a file to the working copy. - * - * @group workflow */ final class ArcanistPatchWorkflow extends ArcanistBaseWorkflow { @@ -66,46 +64,35 @@ 'patch' => array( 'param' => 'patchfile', 'paramtype' => 'file', - 'help' => - 'Apply changes from a git patchfile or unified patchfile.', + 'help' => 'Apply changes from a git patchfile or unified patchfile.', ), 'encoding' => array( 'param' => 'encoding', - 'help' => - 'Attempt to convert non UTF-8 patch into specified encoding.', + 'help' => 'Attempt to convert non UTF-8 patch into specified encoding.', ), 'update' => array( - 'supports' => array( - 'git', 'svn', 'hg' - ), - 'help' => - 'Update the local working copy before applying the patch.', + 'supports' => array('git', 'svn', 'hg'), + 'help' => 'Update the local working copy before applying the patch.', 'conflicts' => array( 'nobranch' => true, 'bookmark' => true, ), ), 'nocommit' => array( - 'supports' => array( - 'git', 'hg' - ), + 'supports' => array('git', 'hg'), 'help' => 'Normally under git/hg, if the patch is successful, the changes '. 'are committed to the working copy. This flag prevents the commit.', ), 'skip-dependencies' => array( - 'supports' => array( - 'git', 'hg' - ), + 'supports' => array('git', 'hg'), 'help' => 'Normally, if a patch has dependencies that are not present in the '. 'working copy, arc tries to apply them as well. This flag prevents '. 'such work.', ), 'nobranch' => array( - 'supports' => array( - 'git', 'hg' - ), + 'supports' => array('git', 'hg'), 'help' => 'Normally, a new branch (git) or bookmark (hg) is created and then '. 'the patch is applied and committed in the new branch/bookmark. '. @@ -116,8 +103,7 @@ ), ), 'force' => array( - 'help' => - 'Do not run any sanity checks.', + 'help' => 'Do not run any sanity checks.', ), '*' => 'name', ); @@ -242,7 +228,7 @@ if (!$branch_name) { throw new Exception( - 'Arc was unable to automagically make a name for this patch. '. + 'Arc was unable to automagically make a name for this patch. '. 'Please clean up your working copy and try again.' ); } @@ -251,7 +237,7 @@ } private function getBookmarkName(ArcanistBundle $bundle) { - $bookmark_name = null; + $bookmark_name = null; $repository_api = $this->getRepositoryAPI(); $revision_id = $bundle->getRevisionID(); $base_name = 'arcpatch'; @@ -325,9 +311,7 @@ $base_revision); } - $repository_api->execxLocal( - 'bookmark %s', - $branch_name); + $repository_api->execxLocal('bookmark %s', $branch_name); echo phutil_console_format( "Created and checked out bookmark %s.\n", @@ -352,7 +336,6 @@ } public function run() { - $source = $this->getSource(); $param = $this->getSourceParam(); try { @@ -831,7 +814,7 @@ if (!$commit_message) { $template = "\n\n". - "# Enter a commit message for this patch. If you just want to apply ". + "# Enter a commit message for this patch. If you just want to apply ". "the patch to the working copy without committing, re-run arc patch ". "with the --nocommit flag.". $prompt_message. @@ -931,7 +914,7 @@ } else if ($bundle_project_id != $working_copy_project_id) { if ($working_copy_project_id) { $issue = - "This patch is for the '{$bundle_project_id}' project, but the ". + "This patch is for the '{$bundle_project_id}' project, but the ". "working copy belongs to the '{$working_copy_project_id}' project."; } else { $issue = @@ -985,17 +968,19 @@ if ($bundle_revision) { $bundle_base_rev_str = $bundle_base_rev. - ' \ D'.$bundle_revision['id']; + ' \ D'.$bundle_revision['id']; } if ($source_revision) { $source_base_rev_str = $source_base_rev. - ' \ D'.$source_revision['id']; + ' \ D'.$source_revision['id']; } } - $bundle_base_rev_str = nonempty($bundle_base_rev_str, - $bundle_base_rev); - $source_base_rev_str = nonempty($source_base_rev_str, - $source_base_rev); + $bundle_base_rev_str = nonempty( + $bundle_base_rev_str, + $bundle_base_rev); + $source_base_rev_str = nonempty( + $source_base_rev_str, + $source_base_rev); $ok = phutil_console_confirm( "This diff is against commit {$bundle_base_rev_str}, but the ". @@ -1090,4 +1075,5 @@ return $graph; } + } diff --git a/src/workflow/ArcanistRevertWorkflow.php b/src/workflow/ArcanistRevertWorkflow.php --- a/src/workflow/ArcanistRevertWorkflow.php +++ b/src/workflow/ArcanistRevertWorkflow.php @@ -1,9 +1,8 @@ writeOut("Please use arc backout instead.\n"); } + } diff --git a/src/workflow/ArcanistSetConfigWorkflow.php b/src/workflow/ArcanistSetConfigWorkflow.php --- a/src/workflow/ArcanistSetConfigWorkflow.php +++ b/src/workflow/ArcanistSetConfigWorkflow.php @@ -23,11 +23,11 @@ Options are either user (apply to all arc commands you invoke from the current user) or local (apply only to the current working - copy). By default, user configuration is written. Use __--local__ + copy). By default, user configuration is written. Use __--local__ to write local configuration. User values are written to '~/.arcrc' on Linux and Mac OS X, and an - undisclosed location on Windows. Local values are written to an arc + undisclosed location on Windows. Local values are written to an arc directory under either .git, .hg, or .svn as appropriate. EOTEXT ); diff --git a/src/workflow/ArcanistShellCompleteWorkflow.php b/src/workflow/ArcanistShellCompleteWorkflow.php --- a/src/workflow/ArcanistShellCompleteWorkflow.php +++ b/src/workflow/ArcanistShellCompleteWorkflow.php @@ -2,8 +2,6 @@ /** * Powers shell-completion scripts. - * - * @group workflow */ final class ArcanistShellCompleteWorkflow extends ArcanistBaseWorkflow { @@ -194,4 +192,5 @@ } } } + } diff --git a/src/workflow/ArcanistSvnHookPreCommitWorkflow.php b/src/workflow/ArcanistSvnHookPreCommitWorkflow.php --- a/src/workflow/ArcanistSvnHookPreCommitWorkflow.php +++ b/src/workflow/ArcanistSvnHookPreCommitWorkflow.php @@ -2,8 +2,6 @@ /** * Installable as an SVN "pre-commit" hook. - * - * @group workflow */ final class ArcanistSvnHookPreCommitWorkflow extends ArcanistBaseWorkflow { @@ -39,7 +37,6 @@ } public function run() { - $svnargs = $this->getArgument('svnargs'); $repository = $svnargs[0]; $transaction = $svnargs[1]; @@ -229,4 +226,5 @@ return 0; } + } diff --git a/src/workflow/ArcanistTasksWorkflow.php b/src/workflow/ArcanistTasksWorkflow.php --- a/src/workflow/ArcanistTasksWorkflow.php +++ b/src/workflow/ArcanistTasksWorkflow.php @@ -1,9 +1,7 @@ 'username', 'help' => 'Only show tasks assigned to the given username, '. - 'also accepts @all to show all, default is you.', + 'also accepts @all to show all, default is you.', 'conflict' => array( 'unassigned' => '--owner suppresses unassigned', ), @@ -59,7 +57,7 @@ 'param' => 'task_order', 'help' => 'Arrange tasks based on priority, created, or modified, '. - 'default is priority.', + 'default is priority.', ), 'limit' => array( 'param' => 'n', diff --git a/src/workflow/ArcanistTodoWorkflow.php b/src/workflow/ArcanistTodoWorkflow.php --- a/src/workflow/ArcanistTodoWorkflow.php +++ b/src/workflow/ArcanistTodoWorkflow.php @@ -1,9 +1,7 @@ getConduit(); $results = array(); diff --git a/src/workflow/ArcanistWhichWorkflow.php b/src/workflow/ArcanistWhichWorkflow.php --- a/src/workflow/ArcanistWhichWorkflow.php +++ b/src/workflow/ArcanistWhichWorkflow.php @@ -73,7 +73,6 @@ } public function run() { - $console = PhutilConsole::getConsole(); $this->printRepositorySection(); diff --git a/src/workingcopyidentity/ArcanistWorkingCopyIdentity.php b/src/workingcopyidentity/ArcanistWorkingCopyIdentity.php --- a/src/workingcopyidentity/ArcanistWorkingCopyIdentity.php +++ b/src/workingcopyidentity/ArcanistWorkingCopyIdentity.php @@ -3,10 +3,7 @@ /** * Interfaces with basic information about the working copy. * - * * @task config - * - * @group workingcopy */ final class ArcanistWorkingCopyIdentity { @@ -284,10 +281,10 @@ } /** - * Read a configuration directive from local configuration. This + * Read a configuration directive from local configuration. This * reads ONLY the per-working copy configuration, * i.e. .(git|hg|svn)/arc/config, and not other configuration - * sources. See @{method:getConfigFromAnySource} to read from any + * sources. See @{method:getConfigFromAnySource} to read from any * config source or @{method:getProjectConfig} to read permanent * project-level config. *