From b1112e73c463a2304c387ddce751ff5137de87f2 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Sat, 27 Sep 2014 10:21:23 +1000 Subject: [PATCH] Minor linter fixes Summary: Apply some linter autofixes. Test Plan: `arc lint` and `arc unit` Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D10568 --- scripts/arcanist.php | 4 ++-- src/configuration/ArcanistSettings.php | 2 +- src/difference/ArcanistDiffUtils.php | 2 +- src/hgdaemon/ArcanistHgProxyServer.php | 2 +- src/lint/linter/ArcanistExternalLinter.php | 2 +- src/lint/linter/ArcanistLesscLinter.php | 3 ++- src/lint/linter/ArcanistLinter.php | 2 +- src/lint/linter/ArcanistPuppetLintLinter.php | 4 +++- src/lint/linter/ArcanistXHPASTLinter.php | 3 ++- src/parser/ArcanistDiffParser.php | 2 +- src/repository/api/ArcanistMercurialAPI.php | 3 ++- src/unit/engine/CSharpToolsTestEngine.php | 6 ++++-- src/workflow/ArcanistBackoutWorkflow.php | 2 +- src/workflow/ArcanistCloseWorkflow.php | 4 ++-- src/workflow/ArcanistCommitWorkflow.php | 4 ++-- src/workflow/ArcanistDiffWorkflow.php | 2 +- src/workflow/ArcanistExportWorkflow.php | 4 ++-- src/workflow/ArcanistLintWorkflow.php | 6 +++--- src/workflow/ArcanistPatchWorkflow.php | 8 +++++--- src/workflow/ArcanistStartWorkflow.php | 2 +- src/workflow/ArcanistUnitWorkflow.php | 4 ++-- 21 files changed, 40 insertions(+), 31 deletions(-) diff --git a/scripts/arcanist.php b/scripts/arcanist.php index 1f692c16..8714bcd1 100755 --- a/scripts/arcanist.php +++ b/scripts/arcanist.php @@ -46,7 +46,7 @@ $base_args->parsePartial( 'repeat' => true, 'help' => 'Specify a runtime configuration value. This will take precedence '. - 'over static values, and only affect the current arcanist invocation.' + 'over static values, and only affect the current arcanist invocation.', ), )); @@ -413,7 +413,7 @@ function sanity_check_environment() { 'text', "You need to install the cURL PHP extension, maybe with ". "'apt-get install php5-curl' or 'yum install php53-curl' or ". - "something similar."), + "something similar.",), 'json_decode' => array('flag', '--without-json'), ); } diff --git a/src/configuration/ArcanistSettings.php b/src/configuration/ArcanistSettings.php index 796bc177..b4c54a9f 100644 --- a/src/configuration/ArcanistSettings.php +++ b/src/configuration/ArcanistSettings.php @@ -126,7 +126,7 @@ final class ArcanistSettings { "Path to a custom CA bundle file to be used for arcanist's cURL ". "calls. This is used primarily when your conduit endpoint is ". "behind https signed by your organization's internal CA.", - 'example' => 'support/yourca.pem' + 'example' => 'support/yourca.pem', ), 'https.blindly-trust-domains' => array( 'type' => 'list', diff --git a/src/difference/ArcanistDiffUtils.php b/src/difference/ArcanistDiffUtils.php index 2c89599e..c789cddc 100644 --- a/src/difference/ArcanistDiffUtils.php +++ b/src/difference/ArcanistDiffUtils.php @@ -52,7 +52,7 @@ final class ArcanistDiffUtils { if (($o === $n) || !$ol || !$nl) { return array( array(array(0, $ol)), - array(array(0, $nl)) + array(array(0, $nl)), ); } diff --git a/src/hgdaemon/ArcanistHgProxyServer.php b/src/hgdaemon/ArcanistHgProxyServer.php index 93ef5af4..a6e19a25 100644 --- a/src/hgdaemon/ArcanistHgProxyServer.php +++ b/src/hgdaemon/ArcanistHgProxyServer.php @@ -177,7 +177,7 @@ final class ArcanistHgProxyServer { array_merge($clients, array($hg)), array( 'read' => $socket ? array($socket) : array(), - 'except' => $socket ? array($socket) : array() + 'except' => $socket ? array($socket) : array(), )); if (!$hg->update()) { diff --git a/src/lint/linter/ArcanistExternalLinter.php b/src/lint/linter/ArcanistExternalLinter.php index e5efb990..f85d09da 100644 --- a/src/lint/linter/ArcanistExternalLinter.php +++ b/src/lint/linter/ArcanistExternalLinter.php @@ -432,7 +432,7 @@ abstract class ArcanistExternalLinter extends ArcanistFutureLinter { 'Specify a string (or list of strings) identifying the binary '. 'which should be invoked to execute this linter. This overrides '. 'the default binary. If you provide a list of possible binaries, '. - 'the first one which exists will be used.') + 'the first one which exists will be used.'), ), 'flags' => array( 'type' => 'optional list', diff --git a/src/lint/linter/ArcanistLesscLinter.php b/src/lint/linter/ArcanistLesscLinter.php index 9e6647e1..00a40436 100644 --- a/src/lint/linter/ArcanistLesscLinter.php +++ b/src/lint/linter/ArcanistLesscLinter.php @@ -121,7 +121,8 @@ final class ArcanistLesscLinter extends ArcanistExternalLinter { '--lint', '--no-color', '--strict-math='.($this->strictMath ? 'on' : 'off'), - '--strict-units='.($this->strictUnits ? 'on' : 'off')); + '--strict-units='.($this->strictUnits ? 'on' : 'off'), + ); } protected function parseLinterOutput($path, $err, $stdout, $stderr) { diff --git a/src/lint/linter/ArcanistLinter.php b/src/lint/linter/ArcanistLinter.php index 76ff9c64..fa43496c 100644 --- a/src/lint/linter/ArcanistLinter.php +++ b/src/lint/linter/ArcanistLinter.php @@ -351,7 +351,7 @@ abstract class ArcanistLinter { 'type' => 'optional map', 'help' => pht( 'Provide a map from lint codes to adjusted severity levels: error, '. - 'warning, advice, autofix or disabled.') + 'warning, advice, autofix or disabled.'), ), 'severity.rules' => array( 'type' => 'optional map', diff --git a/src/lint/linter/ArcanistPuppetLintLinter.php b/src/lint/linter/ArcanistPuppetLintLinter.php index 230ce540..efe83e9d 100644 --- a/src/lint/linter/ArcanistPuppetLintLinter.php +++ b/src/lint/linter/ArcanistPuppetLintLinter.php @@ -63,7 +63,9 @@ final class ArcanistPuppetLintLinter extends ArcanistExternalLinter { '%{column}', '%{kind}', '%{check}', - '%{message}')))); + '%{message}', + ))), + ); } public function getLinterConfigurationOptions() { diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php index 183da16e..2a84ed30 100644 --- a/src/lint/linter/ArcanistXHPASTLinter.php +++ b/src/lint/linter/ArcanistXHPASTLinter.php @@ -1840,7 +1840,8 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter { $global, // No advice for globals, but hooks have an option to provide some. - null); + null, + ); } // Exclude access of static properties, since lint will be raised at diff --git a/src/parser/ArcanistDiffParser.php b/src/parser/ArcanistDiffParser.php index 658601c3..bbe01d0f 100644 --- a/src/parser/ArcanistDiffParser.php +++ b/src/parser/ArcanistDiffParser.php @@ -564,7 +564,7 @@ final class ArcanistDiffParser { 'rename from (?P.*)', '(?Prename) to (?P.*)', 'copy from (?P.*)', - '(?Pcopy) to (?P.*)' + '(?Pcopy) to (?P.*)', ); $ok = false; diff --git a/src/repository/api/ArcanistMercurialAPI.php b/src/repository/api/ArcanistMercurialAPI.php index 27e579e8..0bd6e60d 100644 --- a/src/repository/api/ArcanistMercurialAPI.php +++ b/src/repository/api/ArcanistMercurialAPI.php @@ -1054,7 +1054,8 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI { $bookmarks[] = array( 'is_active' => $is_active, 'name' => $name, - 'revision' => $revision); + 'revision' => $revision, + ); } } diff --git a/src/unit/engine/CSharpToolsTestEngine.php b/src/unit/engine/CSharpToolsTestEngine.php index aec00c73..03ad75bb 100644 --- a/src/unit/engine/CSharpToolsTestEngine.php +++ b/src/unit/engine/CSharpToolsTestEngine.php @@ -133,7 +133,8 @@ final class CSharpToolsTestEngine extends XUnitTestEngine { return array( $future, $assembly_dir.DIRECTORY_SEPARATOR.$xunit_temp, - $cover_temp); + $cover_temp, + ); } /** @@ -195,7 +196,8 @@ final class CSharpToolsTestEngine extends XUnitTestEngine { $results[] = array( 'file' => $tag->getAttribute('file'), 'start' => $tag->getAttribute('start'), - 'end' => $tag->getAttribute('end')); + 'end' => $tag->getAttribute('end'), + ); } return $results; } diff --git a/src/workflow/ArcanistBackoutWorkflow.php b/src/workflow/ArcanistBackoutWorkflow.php index 6b12bc04..7d37853a 100644 --- a/src/workflow/ArcanistBackoutWorkflow.php +++ b/src/workflow/ArcanistBackoutWorkflow.php @@ -118,7 +118,7 @@ EOTEXT array( 'revision_id' => null, 'edit' => 'create', - 'fields' => $fields + 'fields' => $fields, )); $template = $this->newInteractiveEditor($template) ->setName('new-commit') diff --git a/src/workflow/ArcanistCloseWorkflow.php b/src/workflow/ArcanistCloseWorkflow.php index 76cde414..083ec355 100644 --- a/src/workflow/ArcanistCloseWorkflow.php +++ b/src/workflow/ArcanistCloseWorkflow.php @@ -129,7 +129,7 @@ EOTEXT $info = $conduit->callMethodSynchronous( 'maniphest.info', array( - 'task_id' => $task_id + 'task_id' => $task_id, )); if ($info['status'] == $status) { return false; @@ -139,7 +139,7 @@ EOTEXT array( 'id' => $task_id, 'status' => $status, - 'comments' => $comment + 'comments' => $comment, )); } diff --git a/src/workflow/ArcanistCommitWorkflow.php b/src/workflow/ArcanistCommitWorkflow.php index 840cc261..dbd2b791 100644 --- a/src/workflow/ArcanistCommitWorkflow.php +++ b/src/workflow/ArcanistCommitWorkflow.php @@ -51,14 +51,14 @@ EOTEXT 'show' => array( 'help' => 'Show the command which would be issued, but do not actually '. - 'commit anything.' + 'commit anything.', ), 'revision' => array( 'param' => 'revision_id', 'help' => 'Commit a specific revision. If you do not specify a revision, '. 'arc will look for committable revisions.', - ) + ), ); } diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index a8e13ab2..b2dd8ffc 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -406,7 +406,7 @@ EOTEXT 'lintall' => '--head suppresses lint.', 'advice' => '--head suppresses lint.', ), - ) + ), ); return $arguments; diff --git a/src/workflow/ArcanistExportWorkflow.php b/src/workflow/ArcanistExportWorkflow.php index a7ebb981..01abb79f 100644 --- a/src/workflow/ArcanistExportWorkflow.php +++ b/src/workflow/ArcanistExportWorkflow.php @@ -70,13 +70,13 @@ EOTEXT 'param' => 'revision_id', 'help' => 'Instead of exporting changes from the working copy, export them '. - 'from a Differential revision.' + 'from a Differential revision.', ), 'diff' => array( 'param' => 'diff_id', 'help' => 'Instead of exporting changes from the working copy, export them '. - 'from a Differential diff.' + 'from a Differential diff.', ), '*' => 'paths', ); diff --git a/src/workflow/ArcanistLintWorkflow.php b/src/workflow/ArcanistLintWorkflow.php index 396e3ed8..20f636a6 100644 --- a/src/workflow/ArcanistLintWorkflow.php +++ b/src/workflow/ArcanistLintWorkflow.php @@ -95,7 +95,7 @@ EOTEXT "With 'json', show lint warnings in machine-readable JSON format. ". "With 'none', show no lint warnings. ". "With 'compiler', show lint warnings in suitable for your editor. ". - "With 'xml', show lint warnings in the Checkstyle XML format." + "With 'xml', show lint warnings in the Checkstyle XML format.", ), 'only-new' => array( 'param' => 'bool', @@ -105,7 +105,7 @@ EOTEXT 'engine' => array( 'param' => 'classname', 'help' => - 'Override configured lint engine for this project.' + 'Override configured lint engine for this project.', ), 'apply-patches' => array( 'help' => @@ -135,7 +135,7 @@ EOTEXT 'help' => 'Lint all files in the project.', 'conflicts' => array( 'cache' => '--everything lints all files', - 'rev' => '--everything lints all files' + 'rev' => '--everything lints all files', ), ), 'severity' => array( diff --git a/src/workflow/ArcanistPatchWorkflow.php b/src/workflow/ArcanistPatchWorkflow.php index 1e7d21bb..167704de 100644 --- a/src/workflow/ArcanistPatchWorkflow.php +++ b/src/workflow/ArcanistPatchWorkflow.php @@ -499,7 +499,8 @@ EOTEXT } else { $copies[] = array( $change->getOldPath(), - $change->getCurrentPath()); + $change->getCurrentPath(), + ); } break; case ArcanistDiffChangeType::TYPE_ADD: @@ -864,7 +865,7 @@ EOTEXT 'differential.query', array( 'phids' => $phids, - 'arcanistProjects' => array($bundle->getProjectID()) + 'arcanistProjects' => array($bundle->getProjectID()), )); $revs = array(); foreach ($dep_on_revs as $dep_on_rev) { @@ -876,7 +877,8 @@ EOTEXT $base_args = array( '--force', '--skip-dependencies', - '--nobranch'); + '--nobranch', + ); if (!$this->shouldCommit()) { $base_args[] = '--nocommit'; } diff --git a/src/workflow/ArcanistStartWorkflow.php b/src/workflow/ArcanistStartWorkflow.php index 389023e5..483f334c 100644 --- a/src/workflow/ArcanistStartWorkflow.php +++ b/src/workflow/ArcanistStartWorkflow.php @@ -63,7 +63,7 @@ EOTEXT $started_phids[] = $conduit->callMethodSynchronous( 'phrequent.push', array( - 'objectPHID' => $object_phid + 'objectPHID' => $object_phid, )); } diff --git a/src/workflow/ArcanistUnitWorkflow.php b/src/workflow/ArcanistUnitWorkflow.php index f8d7a15b..f302ba75 100644 --- a/src/workflow/ArcanistUnitWorkflow.php +++ b/src/workflow/ArcanistUnitWorkflow.php @@ -52,7 +52,7 @@ EOTEXT 'engine' => array( 'param' => 'classname', 'help' => - 'Override configured unit engine for this project.' + 'Override configured unit engine for this project.', ), 'coverage' => array( 'help' => 'Always enable coverage information.', @@ -80,7 +80,7 @@ EOTEXT 'conflicts' => array( 'json' => 'Only one output format allowed', 'ugly' => 'Only one output format allowed', - ) + ), ), 'everything' => array( 'help' => 'Run every test.', -- 2.43.0