1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-21 22:32:41 +01:00

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
This commit is contained in:
Joshua Spence 2014-09-27 10:21:23 +10:00
parent 8ed1459ecd
commit b1112e73c4
21 changed files with 40 additions and 31 deletions

View file

@ -46,7 +46,7 @@ $base_args->parsePartial(
'repeat' => true, 'repeat' => true,
'help' => 'help' =>
'Specify a runtime configuration value. This will take precedence '. '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', 'text',
"You need to install the cURL PHP extension, maybe with ". "You need to install the cURL PHP extension, maybe with ".
"'apt-get install php5-curl' or 'yum install php53-curl' or ". "'apt-get install php5-curl' or 'yum install php53-curl' or ".
"something similar."), "something similar.",),
'json_decode' => array('flag', '--without-json'), 'json_decode' => array('flag', '--without-json'),
); );
} }

View file

@ -126,7 +126,7 @@ final class ArcanistSettings {
"Path to a custom CA bundle file to be used for arcanist's cURL ". "Path to a custom CA bundle file to be used for arcanist's cURL ".
"calls. This is used primarily when your conduit endpoint is ". "calls. This is used primarily when your conduit endpoint is ".
"behind https signed by your organization's internal CA.", "behind https signed by your organization's internal CA.",
'example' => 'support/yourca.pem' 'example' => 'support/yourca.pem',
), ),
'https.blindly-trust-domains' => array( 'https.blindly-trust-domains' => array(
'type' => 'list', 'type' => 'list',

View file

@ -52,7 +52,7 @@ final class ArcanistDiffUtils {
if (($o === $n) || !$ol || !$nl) { if (($o === $n) || !$ol || !$nl) {
return array( return array(
array(array(0, $ol)), array(array(0, $ol)),
array(array(0, $nl)) array(array(0, $nl)),
); );
} }

View file

@ -177,7 +177,7 @@ final class ArcanistHgProxyServer {
array_merge($clients, array($hg)), array_merge($clients, array($hg)),
array( array(
'read' => $socket ? array($socket) : array(), 'read' => $socket ? array($socket) : array(),
'except' => $socket ? array($socket) : array() 'except' => $socket ? array($socket) : array(),
)); ));
if (!$hg->update()) { if (!$hg->update()) {

View file

@ -432,7 +432,7 @@ abstract class ArcanistExternalLinter extends ArcanistFutureLinter {
'Specify a string (or list of strings) identifying the binary '. 'Specify a string (or list of strings) identifying the binary '.
'which should be invoked to execute this linter. This overrides '. 'which should be invoked to execute this linter. This overrides '.
'the default binary. If you provide a list of possible binaries, '. '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( 'flags' => array(
'type' => 'optional list<string>', 'type' => 'optional list<string>',

View file

@ -121,7 +121,8 @@ final class ArcanistLesscLinter extends ArcanistExternalLinter {
'--lint', '--lint',
'--no-color', '--no-color',
'--strict-math='.($this->strictMath ? 'on' : 'off'), '--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) { protected function parseLinterOutput($path, $err, $stdout, $stderr) {

View file

@ -351,7 +351,7 @@ abstract class ArcanistLinter {
'type' => 'optional map<string|int, string>', 'type' => 'optional map<string|int, string>',
'help' => pht( 'help' => pht(
'Provide a map from lint codes to adjusted severity levels: error, '. 'Provide a map from lint codes to adjusted severity levels: error, '.
'warning, advice, autofix or disabled.') 'warning, advice, autofix or disabled.'),
), ),
'severity.rules' => array( 'severity.rules' => array(
'type' => 'optional map<string, string>', 'type' => 'optional map<string, string>',

View file

@ -63,7 +63,9 @@ final class ArcanistPuppetLintLinter extends ArcanistExternalLinter {
'%{column}', '%{column}',
'%{kind}', '%{kind}',
'%{check}', '%{check}',
'%{message}')))); '%{message}',
))),
);
} }
public function getLinterConfigurationOptions() { public function getLinterConfigurationOptions() {

View file

@ -1840,7 +1840,8 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
$global, $global,
// No advice for globals, but hooks have an option to provide some. // 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 // Exclude access of static properties, since lint will be raised at

View file

@ -564,7 +564,7 @@ final class ArcanistDiffParser {
'rename from (?P<old>.*)', 'rename from (?P<old>.*)',
'(?P<move>rename) to (?P<cur>.*)', '(?P<move>rename) to (?P<cur>.*)',
'copy from (?P<old>.*)', 'copy from (?P<old>.*)',
'(?P<copy>copy) to (?P<cur>.*)' '(?P<copy>copy) to (?P<cur>.*)',
); );
$ok = false; $ok = false;

View file

@ -1054,7 +1054,8 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
$bookmarks[] = array( $bookmarks[] = array(
'is_active' => $is_active, 'is_active' => $is_active,
'name' => $name, 'name' => $name,
'revision' => $revision); 'revision' => $revision,
);
} }
} }

View file

@ -133,7 +133,8 @@ final class CSharpToolsTestEngine extends XUnitTestEngine {
return array( return array(
$future, $future,
$assembly_dir.DIRECTORY_SEPARATOR.$xunit_temp, $assembly_dir.DIRECTORY_SEPARATOR.$xunit_temp,
$cover_temp); $cover_temp,
);
} }
/** /**
@ -195,7 +196,8 @@ final class CSharpToolsTestEngine extends XUnitTestEngine {
$results[] = array( $results[] = array(
'file' => $tag->getAttribute('file'), 'file' => $tag->getAttribute('file'),
'start' => $tag->getAttribute('start'), 'start' => $tag->getAttribute('start'),
'end' => $tag->getAttribute('end')); 'end' => $tag->getAttribute('end'),
);
} }
return $results; return $results;
} }

View file

@ -118,7 +118,7 @@ EOTEXT
array( array(
'revision_id' => null, 'revision_id' => null,
'edit' => 'create', 'edit' => 'create',
'fields' => $fields 'fields' => $fields,
)); ));
$template = $this->newInteractiveEditor($template) $template = $this->newInteractiveEditor($template)
->setName('new-commit') ->setName('new-commit')

View file

@ -129,7 +129,7 @@ EOTEXT
$info = $conduit->callMethodSynchronous( $info = $conduit->callMethodSynchronous(
'maniphest.info', 'maniphest.info',
array( array(
'task_id' => $task_id 'task_id' => $task_id,
)); ));
if ($info['status'] == $status) { if ($info['status'] == $status) {
return false; return false;
@ -139,7 +139,7 @@ EOTEXT
array( array(
'id' => $task_id, 'id' => $task_id,
'status' => $status, 'status' => $status,
'comments' => $comment 'comments' => $comment,
)); ));
} }

View file

@ -51,14 +51,14 @@ EOTEXT
'show' => array( 'show' => array(
'help' => 'help' =>
'Show the command which would be issued, but do not actually '. 'Show the command which would be issued, but do not actually '.
'commit anything.' 'commit anything.',
), ),
'revision' => array( 'revision' => array(
'param' => 'revision_id', 'param' => 'revision_id',
'help' => 'help' =>
'Commit a specific revision. If you do not specify a revision, '. 'Commit a specific revision. If you do not specify a revision, '.
'arc will look for committable revisions.', 'arc will look for committable revisions.',
) ),
); );
} }

View file

@ -406,7 +406,7 @@ EOTEXT
'lintall' => '--head suppresses lint.', 'lintall' => '--head suppresses lint.',
'advice' => '--head suppresses lint.', 'advice' => '--head suppresses lint.',
), ),
) ),
); );
return $arguments; return $arguments;

View file

@ -70,13 +70,13 @@ EOTEXT
'param' => 'revision_id', 'param' => 'revision_id',
'help' => 'help' =>
'Instead of exporting changes from the working copy, export them '. 'Instead of exporting changes from the working copy, export them '.
'from a Differential revision.' 'from a Differential revision.',
), ),
'diff' => array( 'diff' => array(
'param' => 'diff_id', 'param' => 'diff_id',
'help' => 'help' =>
'Instead of exporting changes from the working copy, export them '. 'Instead of exporting changes from the working copy, export them '.
'from a Differential diff.' 'from a Differential diff.',
), ),
'*' => 'paths', '*' => 'paths',
); );

View file

@ -95,7 +95,7 @@ EOTEXT
"With 'json', show lint warnings in machine-readable JSON format. ". "With 'json', show lint warnings in machine-readable JSON format. ".
"With 'none', show no lint warnings. ". "With 'none', show no lint warnings. ".
"With 'compiler', show lint warnings in suitable for your editor. ". "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( 'only-new' => array(
'param' => 'bool', 'param' => 'bool',
@ -105,7 +105,7 @@ EOTEXT
'engine' => array( 'engine' => array(
'param' => 'classname', 'param' => 'classname',
'help' => 'help' =>
'Override configured lint engine for this project.' 'Override configured lint engine for this project.',
), ),
'apply-patches' => array( 'apply-patches' => array(
'help' => 'help' =>
@ -135,7 +135,7 @@ EOTEXT
'help' => 'Lint all files in the project.', 'help' => 'Lint all files in the project.',
'conflicts' => array( 'conflicts' => array(
'cache' => '--everything lints all files', 'cache' => '--everything lints all files',
'rev' => '--everything lints all files' 'rev' => '--everything lints all files',
), ),
), ),
'severity' => array( 'severity' => array(

View file

@ -499,7 +499,8 @@ EOTEXT
} else { } else {
$copies[] = array( $copies[] = array(
$change->getOldPath(), $change->getOldPath(),
$change->getCurrentPath()); $change->getCurrentPath(),
);
} }
break; break;
case ArcanistDiffChangeType::TYPE_ADD: case ArcanistDiffChangeType::TYPE_ADD:
@ -864,7 +865,7 @@ EOTEXT
'differential.query', 'differential.query',
array( array(
'phids' => $phids, 'phids' => $phids,
'arcanistProjects' => array($bundle->getProjectID()) 'arcanistProjects' => array($bundle->getProjectID()),
)); ));
$revs = array(); $revs = array();
foreach ($dep_on_revs as $dep_on_rev) { foreach ($dep_on_revs as $dep_on_rev) {
@ -876,7 +877,8 @@ EOTEXT
$base_args = array( $base_args = array(
'--force', '--force',
'--skip-dependencies', '--skip-dependencies',
'--nobranch'); '--nobranch',
);
if (!$this->shouldCommit()) { if (!$this->shouldCommit()) {
$base_args[] = '--nocommit'; $base_args[] = '--nocommit';
} }

View file

@ -63,7 +63,7 @@ EOTEXT
$started_phids[] = $conduit->callMethodSynchronous( $started_phids[] = $conduit->callMethodSynchronous(
'phrequent.push', 'phrequent.push',
array( array(
'objectPHID' => $object_phid 'objectPHID' => $object_phid,
)); ));
} }

View file

@ -52,7 +52,7 @@ EOTEXT
'engine' => array( 'engine' => array(
'param' => 'classname', 'param' => 'classname',
'help' => 'help' =>
'Override configured unit engine for this project.' 'Override configured unit engine for this project.',
), ),
'coverage' => array( 'coverage' => array(
'help' => 'Always enable coverage information.', 'help' => 'Always enable coverage information.',
@ -80,7 +80,7 @@ EOTEXT
'conflicts' => array( 'conflicts' => array(
'json' => 'Only one output format allowed', 'json' => 'Only one output format allowed',
'ugly' => 'Only one output format allowed', 'ugly' => 'Only one output format allowed',
) ),
), ),
'everything' => array( 'everything' => array(
'help' => 'Run every test.', 'help' => 'Run every test.',