Skip to content

Commit

Permalink
Change double quotes to single quotes.
Browse files Browse the repository at this point in the history
Summary: Ran `arc lint --apply-patches --everything` over rARC, mainly to change double quotes to single quotes where appropriate. These changes also validate that the `ArcanistXHPASTLinter::LINT_DOUBLE_QUOTE` rule is working as expected.

Test Plan: Eyeballed //most// of the diff.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin, aurelijus

Differential Revision: https://secure.phabricator.com/D9269
  • Loading branch information
joshuaspence authored and epriestley committed May 23, 2014
1 parent e34bdf6 commit 1782044
Show file tree
Hide file tree
Showing 78 changed files with 521 additions and 521 deletions.
6 changes: 3 additions & 3 deletions scripts/arcanist.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@
if ($need_working_copy || $want_working_copy) {
if ($need_working_copy && !$working_copy->getVCSType()) {
throw new ArcanistUsageException(
"This command must be run in a Git, Mercurial or Subversion working ".
"copy.");
'This command must be run in a Git, Mercurial or Subversion working '.
'copy.');
}
$configuration_manager->setWorkingCopyIdentity($working_copy);
}
Expand Down Expand Up @@ -352,7 +352,7 @@
echo phutil_console_format(
"**Exception**\n%s\n%s\n",
$ex->getMessage(),
"(Run with --trace for a full exception trace.)");
'(Run with --trace for a full exception trace.)');
}

exit(1);
Expand Down
2 changes: 1 addition & 1 deletion scripts/hgdaemon/hgdaemon_client.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

$repo = $args->getArg('repository');
if (count($repo) !== 1) {
throw new Exception("Specify exactly one working copy!");
throw new Exception('Specify exactly one working copy!');
}
$repo = head($repo);

Expand Down
2 changes: 1 addition & 1 deletion scripts/hgdaemon/hgdaemon_server.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

$repo = $args->getArg('repository');
if (count($repo) !== 1) {
throw new Exception("Specify exactly one working copy!");
throw new Exception('Specify exactly one working copy!');
}
$repo = head($repo);

Expand Down
2 changes: 1 addition & 1 deletion scripts/lib/PhutilLibraryMapBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function buildMap() {
$result['error']);
exit(1);
}
$this->log(".");
$this->log('.');
}
$this->log("\nDone.\n");
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/phutil_rebuild_map.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

$root = $args->getArg('root');
if (count($root) !== 1) {
throw new Exception("Provide exactly one library root!");
throw new Exception('Provide exactly one library root!');
}
$root = Filesystem::resolvePath(head($root));

Expand Down
2 changes: 1 addition & 1 deletion scripts/phutil_symbols.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class declarations are "have" symbols, while object instantiations

$paths = $args->getArg('path');
if (count($paths) !== 1) {
throw new Exception("Specify exactly one path!");
throw new Exception('Specify exactly one path!');
}
$path = Filesystem::resolvePath(head($paths));

Expand Down
2 changes: 1 addition & 1 deletion src/configuration/ArcanistConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ final public function selectWorkflow(
private function raiseUnknownCommand($command, array $maybe = array()) {
$message = pht("Unknown command '%s'. Try 'arc help'.", $command);
if ($maybe) {
$message .= "\n\n".pht("Did you mean:")."\n";
$message .= "\n\n".pht('Did you mean:')."\n";
sort($maybe);
foreach ($maybe as $other) {
$message .= " ".$other."\n";
Expand Down
4 changes: 2 additions & 2 deletions src/configuration/ArcanistConfigurationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function writeLocalArcConfig(array $config) {
return $this->workingCopy->writeLocalArcConfig($config);
}

throw new Exception(pht("No working copy to write config to!"));
throw new Exception(pht('No working copy to write config to!'));
}

/**
Expand Down Expand Up @@ -235,7 +235,7 @@ public function writeUserConfigurationFile($config) {
public function setUserConfigurationFileLocation($custom_arcrc) {
if (!Filesystem::pathExists($custom_arcrc)) {
throw new Exception(
"Custom arcrc file was specified, but it was not found!");
'Custom arcrc file was specified, but it was not found!');
}

$this->customArcrcFilename = $custom_arcrc;
Expand Down
6 changes: 3 additions & 3 deletions src/configuration/ArcanistSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private function getOptions() {
'browser' => array(
'type' => 'string',
'help' =>
"Command to use to invoke a web browser.",
'Command to use to invoke a web browser.',
'example' => '"gnome-www-browser"',
),
'events.listeners' => array(
Expand All @@ -154,13 +154,13 @@ private function getOptions() {
'http.basicauth.user' => array(
'type' => 'string',
'help' =>
"Username to use for basic auth over http transports",
'Username to use for basic auth over http transports',
'example' => '"bob"',
),
'http.basicauth.pass' => array(
'type' => 'string',
'help' =>
"Password to use for basic auth over http transports",
'Password to use for basic auth over http transports',
'example' => '"bobhasasecret"',
),
'arc.autostash' => array(
Expand Down
18 changes: 9 additions & 9 deletions src/difference/__tests__/ArcanistDiffUtilsTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function testLevenshtein() {

$utf8_tests = array(
array(
"GrumpyCat",
'GrumpyCat',
"Grumpy\xE2\x98\x83at",
'ssssssxss',
),
Expand All @@ -118,8 +118,8 @@ public function testLevenshtein() {

public function testGenerateUTF8IntralineDiff() {
// Both Strings Empty.
$left = "";
$right = "";
$left = '';
$right = '';
$result = array(
array(array(0, 0)),
array(array(0, 0))
Expand All @@ -129,7 +129,7 @@ public function testGenerateUTF8IntralineDiff() {
ArcanistDiffUtils::generateIntralineDiff($left, $right));

// Left String Empty.
$left = "";
$left = '';
$right = "Grumpy\xE2\x98\x83at";
$result = array(
array(array(0, 0)),
Expand All @@ -141,7 +141,7 @@ public function testGenerateUTF8IntralineDiff() {

// Right String Empty.
$left = "Grumpy\xE2\x98\x83at";
$right = "";
$right = '';
$result = array(
array(array(0, 11)),
array(array(0, 0))
Expand All @@ -163,7 +163,7 @@ public function testGenerateUTF8IntralineDiff() {

// Both Strings are different.
$left = "Grumpy\xE2\x98\x83at";
$right = "Smiling Dog";
$right = 'Smiling Dog';
$result = array(
array(array(1, 11)),
array(array(1, 11))
Expand All @@ -173,7 +173,7 @@ public function testGenerateUTF8IntralineDiff() {
ArcanistDiffUtils::generateIntralineDiff($left, $right));

// String with one difference in the middle.
$left = "GrumpyCat";
$left = 'GrumpyCat';
$right = "Grumpy\xE2\x98\x83at";
$result = array(
array(array(0, 6), array(1, 1), array(0, 2)),
Expand All @@ -184,7 +184,7 @@ public function testGenerateUTF8IntralineDiff() {
ArcanistDiffUtils::generateIntralineDiff($left, $right));

// Differences in middle, not connected to each other.
$left = "GrumpyCat";
$left = 'GrumpyCat';
$right = "Grumpy\xE2\x98\x83a\xE2\x98\x83t";
$result = array(
array(array(0, 6), array(1, 2), array(0, 1)),
Expand Down Expand Up @@ -229,7 +229,7 @@ public function testGenerateUTF8IntralineDiff() {

// This is a unicode combining character, "COMBINING DOUBLE TILDE".
$cc = "\xCD\xA0";
$left = "Senor";
$left = 'Senor';
$right = "Sen{$cc}or";
$result = array(
array(array(0, 2), array(1, 1), array(0, 2)),
Expand Down
2 changes: 1 addition & 1 deletion src/hgdaemon/ArcanistHgClientChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ final class ArcanistHgClientChannel extends PhutilProtocolChannel {
*/
protected function encodeMessage($argv) {
if (!is_array($argv) || count($argv) !== 2) {
throw new Exception("Message should be <channel, data>.");
throw new Exception('Message should be <channel, data>.');
}

$channel = head($argv);
Expand Down
6 changes: 3 additions & 3 deletions src/hgdaemon/ArcanistHgProxyServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function start() {
));

if (!$hg->update()) {
throw new Exception("Server exited unexpectedly!");
throw new Exception('Server exited unexpectedly!');
}

// Accept any new clients.
Expand Down Expand Up @@ -353,7 +353,7 @@ private function startWorkingCopySocket() {

$ok = stream_set_blocking($socket, 0);
if ($ok === false) {
throw new Exception("Unable to set socket nonblocking!");
throw new Exception('Unable to set socket nonblocking!');
}

return $socket;
Expand Down Expand Up @@ -461,7 +461,7 @@ private function daemonize() {

$pid = pcntl_fork();
if ($pid === -1) {
throw new Exception("Unable to fork!");
throw new Exception('Unable to fork!');
} else if ($pid) {
// We're the parent; exit. First, drop our reference to the socket so
// our __destruct() doesn't tear it down; the child will tear it down
Expand Down
2 changes: 1 addition & 1 deletion src/hgdaemon/ArcanistHgServerChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ final class ArcanistHgServerChannel extends PhutilProtocolChannel {
*/
protected function encodeMessage($argv) {
if (!is_array($argv)) {
throw new Exception("Message to Mercurial server should be an array.");
throw new Exception('Message to Mercurial server should be an array.');
}

$command = head($argv);
Expand Down
2 changes: 1 addition & 1 deletion src/lint/ArcanistLintPatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function writePatchToDisk() {
}
Filesystem::writeFile($lint, $data);

list($err) = exec_manual("mv -f %s %s", $lint, $path);
list($err) = exec_manual('mv -f %s %s', $lint, $path);
if ($err) {
throw new Exception(
"Unable to overwrite path `{$path}', patched version was left ".
Expand Down
4 changes: 2 additions & 2 deletions src/lint/engine/ArcanistLintEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ final public function getCommitHookMode() {
final public function run() {
$linters = $this->buildLinters();
if (!$linters) {
throw new ArcanistNoEffectException("No linters to run.");
throw new ArcanistNoEffectException('No linters to run.');
}

$linters = msort($linters, 'getLinterPriority');
Expand All @@ -225,7 +225,7 @@ final public function run() {
}

if (!$have_paths) {
throw new ArcanistNoEffectException("No paths are lintable.");
throw new ArcanistNoEffectException('No paths are lintable.');
}

$versions = array($this->getCacheVersion());
Expand Down
36 changes: 18 additions & 18 deletions src/lint/linter/ArcanistCSharpLinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function getLintCodeFromLinterConfigurationKey($code) {

public function setCustomSeverityMap(array $map) {
foreach ($map as $code => $severity) {
if (substr($code, 0, 2) === "SA" && $severity == "disabled") {
if (substr($code, 0, 2) === 'SA' && $severity == 'disabled') {
throw new Exception(
"In order to keep StyleCop integration with IDEs and other tools ".
"consistent with Arcanist results, you aren't permitted to ".
Expand Down Expand Up @@ -88,42 +88,42 @@ private function loadEnvironment() {

// Determine runtime engine (.NET or Mono).
if (phutil_is_windows()) {
$this->runtimeEngine = "";
} else if (Filesystem::binaryExists("mono")) {
$this->runtimeEngine = "mono ";
$this->runtimeEngine = '';
} else if (Filesystem::binaryExists('mono')) {
$this->runtimeEngine = 'mono ';
} else {
throw new Exception("Unable to find Mono and you are not on Windows!");
throw new Exception('Unable to find Mono and you are not on Windows!');
}

// Determine cslint path.
$cslint = $this->cslintHintPath;
if ($cslint !== null && file_exists($cslint)) {
$this->cslintEngine = Filesystem::resolvePath($cslint);
} else if (Filesystem::binaryExists("cslint.exe")) {
$this->cslintEngine = "cslint.exe";
} else if (Filesystem::binaryExists('cslint.exe')) {
$this->cslintEngine = 'cslint.exe';
} else {
throw new Exception("Unable to locate cslint.");
throw new Exception('Unable to locate cslint.');
}

// Determine cslint version.
$ver_future = new ExecFuture(
"%C -v",
'%C -v',
$this->runtimeEngine.$this->cslintEngine);
list($err, $stdout, $stderr) = $ver_future->resolve();
if ($err !== 0) {
throw new Exception(
"You are running an old version of cslint. Please ".
"upgrade to version ".self::SUPPORTED_VERSION.".");
'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 ".
"upgrade to version ".self::SUPPORTED_VERSION.".");
} elseif ($ver > self::SUPPORTED_VERSION) {
'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`.");
'Arcanist does not support this version of cslint (it is '.
'newer). You can try upgrading Arcanist with `arc upgrade`.');
}

$this->loaded = true;
Expand Down Expand Up @@ -158,7 +158,7 @@ public function willLintPaths(array $paths) {
// settings JSON through base64-encoded to mitigate
// this issue.
$futures[] = new ExecFuture(
"%C --settings-base64=%s -r=. %Ls",
'%C --settings-base64=%s -r=. %Ls',
$this->runtimeEngine.$this->cslintEngine,
base64_encode(json_encode($this->discoveryMap)),
$current_paths);
Expand All @@ -173,7 +173,7 @@ public function willLintPaths(array $paths) {
// a future for those too.
if (count($current_paths) > 0) {
$futures[] = new ExecFuture(
"%C --settings-base64=%s -r=. %Ls",
'%C --settings-base64=%s -r=. %Ls',
$this->runtimeEngine.$this->cslintEngine,
base64_encode(json_encode($this->discoveryMap)),
$current_paths);
Expand Down
2 changes: 1 addition & 1 deletion src/lint/linter/ArcanistExternalLinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function shouldUseInterpreter() {
* @task bin
*/
public function getDefaultInterpreter() {
throw new Exception("Incomplete implementation!");
throw new Exception('Incomplete implementation!');
}


Expand Down
8 changes: 4 additions & 4 deletions src/lint/linter/ArcanistFlake8Linter.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ protected function getLintCodeFromLinterConfigurationKey($code) {
'Unrecognized lint message code "%s". Expected a valid flake8 '.
'lint code like "%s", or "%s", or "%s", or "%s".',
$code,
"E225",
"W291",
"F811",
"C901"));
'E225',
'W291',
'F811',
'C901'));
}

return $code;
Expand Down
2 changes: 1 addition & 1 deletion src/lint/linter/ArcanistLinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ final public function getLintMessageName($code) {
if (isset($map[$code])) {
return $map[$code];
}
return "Unknown lint message!";
return 'Unknown lint message!';
}

final protected function addLintMessage(ArcanistLintMessage $message) {
Expand Down
4 changes: 2 additions & 2 deletions src/lint/linter/ArcanistPEP8Linter.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ protected function getLintCodeFromLinterConfigurationKey($code) {
'Unrecognized lint message code "%s". Expected a valid PEP8 '.
'lint code like "%s" or "%s".',
$code,
"E101",
"W291"));
'E101',
'W291'));
}

return $code;
Expand Down
Loading

0 comments on commit 1782044

Please sign in to comment.