]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Apply new whitespace lint rules to arcanist/
authorepriestley <git@epriestley.com>
Tue, 19 Feb 2013 22:09:20 +0000 (14:09 -0800)
committerepriestley <git@epriestley.com>
Tue, 19 Feb 2013 22:09:20 +0000 (14:09 -0800)
Summary: Automated changes from `arc lint`.

Test Plan: Looked them over.

Reviewers: vrana

Reviewed By: vrana

CC: aran
Differential Revision: https://secure.phabricator.com/D5017

17 files changed:
src/difference/__tests__/ArcanistDiffUtilsTestCase.php
src/lint/linter/ArcanistConduitLinter.php
src/lint/linter/ArcanistCppcheckLinter.php
src/lint/linter/ArcanistFilenameLinter.php
src/lint/linter/ArcanistSpellingLinter.php
src/lint/linter/ArcanistXHPASTLinter.php
src/lint/renderer/ArcanistLintConsoleRenderer.php
src/lint/renderer/ArcanistLintLikeCompilerRenderer.php
src/parser/__tests__/ArcanistDiffParserTestCase.php
src/repository/api/ArcanistMercurialAPI.php
src/unit/engine/phutil/ArcanistPhutilTestCase.php
src/workflow/ArcanistAmendWorkflow.php
src/workflow/ArcanistBrowseWorkflow.php
src/workflow/ArcanistCloseRevisionWorkflow.php
src/workflow/ArcanistFlagWorkflow.php
src/workflow/ArcanistPatchWorkflow.php
src/workflow/ArcanistTasksWorkflow.php

index 4938542f6aaa62f96296b699c518bebfce3f95a8..308f89fce407ad43c08eaeee9a7966aa0d343fb1 100644 (file)
@@ -92,8 +92,9 @@ final class ArcanistDiffUtilsTestCase extends ArcanistTestCase {
     foreach ($tests as $test) {
       $this->assertEqual(
         $test[2],
-        ArcanistDiffUtils::buildLevenshteinDifferenceString($test[0], $test[1])
-      );
+        ArcanistDiffUtils::buildLevenshteinDifferenceString(
+          $test[0],
+          $test[1]));
     }
   }
 }
index 741d04fb6226f5305cccfad7ff192291b29a1847..1545b494bb4f020d83002e9bcb15a1955cda5041 100644 (file)
@@ -56,8 +56,7 @@ final class ArcanistConduitLinter extends ArcanistLinter {
       self::CONDUIT_METHOD,
       array(
         'file_contents' => $this->data,
-      )
-    );
+      ));
   }
 
   public function lintPath($path) {
index 6b8fcf4eb198a991c9e1c55a266fc9f68dc7f07e..767cb38a1a51dbfa26b73f48dedb8d8e4a369d13 100644 (file)
@@ -23,8 +23,7 @@ final class ArcanistCppcheckLinter extends ArcanistLinter {
     // You will for sure want some options.  The below default tends to be ok
     $options = $working_copy->getConfig(
       'lint.cppcheck.options',
-      '-j2 --inconclusive --enable=performance,style,portability,information'
-    );
+      '-j2 --inconclusive --enable=performance,style,portability,information');
 
     return $options;
   }
@@ -70,8 +69,7 @@ final class ArcanistCppcheckLinter extends ArcanistLinter {
       "%C %C --inline-suppr --xml-version=2 -q %s",
       $bin,
       $options,
-      $this->getEngine()->getFilePathOnDisk($path)
-    );
+      $this->getEngine()->getFilePathOnDisk($path));
 
     if ($rc === 1) {
       throw new Exception("cppcheck failed to run correctly:\n".$stderr);
index b8a81d761b9feca11b4b2a7da64bf34ca3061051..17cb0d916196d7626cd88d38005539fc5c817542 100644 (file)
@@ -14,7 +14,7 @@ final class ArcanistFilenameLinter extends ArcanistLinter {
   }
 
   public function getLinterName() {
-    return 'NAM';
+    return 'NAME';
   }
 
   public function getLintSeverityMap() {
index 928bad430eabc3fdbd05b014747a62bef388f38f..6aee8ead6d5382b609b7a6e19a03ff663a44bb08 100644 (file)
@@ -110,11 +110,9 @@ final class ArcanistSpellingLinter extends ArcanistLinter {
         sprintf(
           "Possible spelling error. You wrote '%s', but did you mean '%s'?",
           $word,
-          $correct_word
-        ),
+          $correct_word),
         $original,
-        $replacement
-      );
+        $replacement);
       $pos = $next + 1;
     }
   }
@@ -126,8 +124,7 @@ final class ArcanistSpellingLinter extends ArcanistLinter {
       '#\b' . preg_quote($word, '#') . '\b#i',
       $text,
       $matches,
-      PREG_OFFSET_CAPTURE
-    );
+      PREG_OFFSET_CAPTURE);
     if (!$num_matches) {
       return;
     }
@@ -140,11 +137,9 @@ final class ArcanistSpellingLinter extends ArcanistLinter {
         sprintf(
           "Possible spelling error. You wrote '%s', but did you mean '%s'?",
           $word,
-          $correct_word
-        ),
+          $correct_word),
         $original,
-        $replacement
-      );
+        $replacement);
     }
   }
 
index 380a021e9a014e684ac8e3584a410d77e45675c3..d21e64f6d44c951b689530b1f0486ab13dd19628 100644 (file)
@@ -1903,8 +1903,7 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
       $decl_name,
       self::LINT_CLASS_FILENAME_MISMATCH,
       "The name of this file differs from the name of the class or interface ".
-      "it declares. Rename the file to '{$rename}'."
-    );
+      "it declares. Rename the file to '{$rename}'.");
   }
 
   private function lintPlusOperatorOnStrings($root) {
index 3f5bcd53f4e9d27585478facbc6dd2ecef6012a2..cea91f50fa25f375f8bc1987e89c25c227a275ee 100644 (file)
@@ -126,13 +126,11 @@ final class ArcanistLintConsoleRenderer implements ArcanistLintRenderer {
       $text = substr(
         $text,
         $same_at_front,
-        $text_strlen - $same_at_end - $same_at_front
-      );
+        $text_strlen - $same_at_end - $same_at_front);
       $patch = substr(
         $patch,
         $same_at_front,
-        $patch_strlen - $same_at_end - $same_at_front
-      );
+        $patch_strlen - $same_at_end - $same_at_front);
     }
     // Print out the impacted region itself.
     $diff = $message->isPatchable() ? '-' : null;
@@ -191,8 +189,7 @@ final class ArcanistLintConsoleRenderer implements ArcanistLintRenderer {
       foreach (array_slice($patch_lines, 1) as $patch_line) {
         $out[] = $this->renderLine(
           null,
-          phutil_console_format('##%s##', $patch_line), false, '+'
-        );
+          phutil_console_format('##%s##', $patch_line), false, '+');
       }
     }
 
index 5f4d64a0bf7f90180c6edfd70997b58edf6dbe21..1b0f4323ece7d285e02abfba82864b8c9f5a7b81 100644 (file)
@@ -23,8 +23,7 @@ final class ArcanistLintLikeCompilerRenderer implements ArcanistLintRenderer {
         $line,
         $severity,
         $code,
-        $description
-      );
+        $description);
     }
 
     return implode('', $lines);
index 7995536c65d5b44829b4e236d413ed8d225f3d38..1ef73820466ab30f0870d43e41e8510cf4adc168 100644 (file)
@@ -108,8 +108,7 @@ EOCORPUS;
           array(
             'duck' => 'quack',
           ),
-          $change->getNewProperties()
-        );
+          $change->getNewProperties());
         break;
       case 'svn-property-modify.svndiff':
         $this->assertEqual(2, count($changes));
@@ -120,14 +119,12 @@ EOCORPUS;
           array(
             'svn:ignore' => '*.phpz',
           ),
-          $change->getOldProperties()
-        );
+          $change->getOldProperties());
         $this->assertEqual(
           array(
             'svn:ignore' => '*.php',
           ),
-          $change->getNewProperties()
-        );
+          $change->getNewProperties());
 
         $change = array_shift($changes);
         $this->assertEqual(0, count($change->getHunks()));
@@ -135,14 +132,12 @@ EOCORPUS;
           array(
             'svn:special' => '*',
           ),
-          $change->getOldProperties()
-        );
+          $change->getOldProperties());
         $this->assertEqual(
           array(
             'svn:special' => 'moo',
           ),
-          $change->getNewProperties()
-        );
+          $change->getNewProperties());
         break;
       case 'svn-property-delete.svndiff':
         $this->assertEqual(1, count($changes));
@@ -219,8 +214,7 @@ EOTEXT
           array(
             'svn:mime-type' => 'application/octet-stream',
           ),
-          $change->getNewProperties()
-        );
+          $change->getNewProperties());
         break;
       case 'svn-binary-diff.svndiff':
         $this->assertEqual(1, count($changes));
@@ -257,14 +251,12 @@ EOTEXT
           array(
             'unix:filemode' => '100644',
           ),
-          $change->getOldProperties()
-        );
+          $change->getOldProperties());
         $this->assertEqual(
           array(
             'unix:filemode' => '100755',
           ),
-          $change->getNewProperties()
-        );
+          $change->getNewProperties());
         break;
       case 'git-filemode-change-only.gitdiff':
         $this->assertEqual(count($changes), 2);
@@ -274,14 +266,12 @@ EOTEXT
           array(
             'unix:filemode' => '100644',
           ),
-          $change->getOldProperties()
-        );
+          $change->getOldProperties());
         $this->assertEqual(
           array(
             'unix:filemode' => '100755',
           ),
-          $change->getNewProperties()
-        );
+          $change->getNewProperties());
         break;
       case 'svn-empty-file.svndiff':
         $this->assertEqual(2, count($changes));
@@ -331,8 +321,7 @@ EOTEXT
         $this->assertEqual(0, count($change->getHunks()));
         $this->assertEqual(
           ArcanistDiffChangeType::TYPE_MOVE_AWAY,
-          $change->getType()
-        );
+          $change->getType());
 
         $this->assertEqual(
           $change->getCurrentPath(),
@@ -410,14 +399,12 @@ EOTEXT
           array(
             'svn:ignore' => 'tags',
           ),
-          $change->getOldProperties()
-        );
+          $change->getOldProperties());
         $this->assertEqual(
           array(
             'svn:ignore' => "tags\nasdf\nlol\nwhat",
           ),
-          $change->getNewProperties()
-        );
+          $change->getNewProperties());
         break;
       case 'git-empty-files.gitdiff':
         $this->assertEqual(2, count($changes));
@@ -472,8 +459,7 @@ DiffCamp Revision: 94064
 
 git-svn-id: svn+ssh://tubbs/svnroot/tfb/trunk/www@223593 2c7ba8d8
 EOTEXT
-          , $change->getMetadata('message')
-        );
+          , $change->getMetadata('message'));
         break;
       case 'git-binary.gitdiff':
         $this->assertEqual(1, count($changes));
index c65d48f1bd8db2c4e3f35e0953330fa1010ecf96..bd9adbf2bfd13623687772635636d52fd3c68061 100644 (file)
@@ -733,8 +733,7 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
           case 'outgoing':
             list($err, $outgoing_base) = $this->execManualLocal(
               'log --template={node} --rev %s',
-              'limit(reverse(ancestors(.) - outgoing()), 1)'
-            );
+              'limit(reverse(ancestors(.) - outgoing()), 1)');
             if (!$err) {
               $this->setBaseCommitExplanation(
                 "it is the first ancestor of the working copy that is not ".
index 57314bef859cc73129bcdbb55a50ccc27d9006fd..2c9126a59bfb515f149f578348ea2bf0a982c482 100644 (file)
@@ -127,8 +127,7 @@ abstract class ArcanistPhutilTestCase {
       array('assertException' => array()),
       array(false),
       $callable,
-      $expected_exception_class
-    );
+      $expected_exception_class);
   }
 
   /**
index ceb504d696ecf1c7e97c2db3acbd87628751deca..1866f100028afdaec4c21b8529acceec6ae81ff1 100644 (file)
@@ -123,8 +123,7 @@ EOTEXT
         array(
           'revision_id' => $revision_id,
           'edit'        => false,
-        )
-      );
+        ));
     } catch (ConduitClientException $ex) {
       if (strpos($ex->getMessage(), 'ERR_NOT_FOUND') === false) {
         throw $ex;
index 584d53fac7f466e635cfdbd9fa84f065f1629f4d..df247be430de786c566b96fb05d64cf789947d5a 100644 (file)
@@ -94,7 +94,7 @@ EOTEXT
     $browser = $this->getBrowserCommand();
 
     foreach ($paths as $path) {
-      $ret_code = phutil_passthru("%s %s", $browser, $base_uri . $path );
+      $ret_code = phutil_passthru("%s %s", $browser, $base_uri . $path);
       if ($ret_code) {
         throw new ArcanistUsageException(
           "It seems we failed to open the browser; Perhaps you should try to ".
@@ -124,7 +124,7 @@ EOTEXT
 
     $branch = $this->getArgument('branch', 'master');
 
-    return $repo_info[$repo_phid]['uri'] . 'browse/' . $branch .'/';
+    return $repo_info[$repo_phid]['uri'].'browse/'.$branch.'/';
   }
 
   private function getBrowserCommand() {
index 0c832a1845cfeb5503eae2a2e9fafd986565f226..e249b54ddfdfa0d3a07c7831fca14909979136e8 100644 (file)
@@ -85,8 +85,7 @@ EOTEXT
         'differential.getrevision',
         array(
           'revision_id' => $revision_id,
-        )
-      );
+        ));
     } catch (Exception $ex) {
       if (!$is_finalize) {
         throw new ArcanistUsageException(
index a76d7ceb1ea506882eda3c18fef0efe9caa60078..e7f25c61af0617fd3dca3e05c2a8f08ac83b3fae 100644 (file)
@@ -168,8 +168,7 @@ EOTEXT
       }
       $flag = $conduit->callMethodSynchronous(
         'flag.edit',
-        $flag_params
-      );
+        $flag_params);
       self::flagWasEdited($flag, $flag['new'] ? 'created' : 'edited');
     } else {
       // Okay, list mode. Let's find the flags, which we didn't need to do
index a8eab2b6ce0974123e5beeb99f9a6bb037dc32a9..53aada793e400a258a8716d5a1483263dc515be0 100644 (file)
@@ -260,8 +260,7 @@ EOTEXT
       // no error means git rev-parse found a branch
       if (!$err) {
         echo phutil_console_format(
-          "Branch name {$proposed_name} already exists; trying a new name.\n"
-        );
+          "Branch name {$proposed_name} already exists; trying a new name.\n");
         continue;
       } else {
         $branch_name = $proposed_name;
@@ -299,8 +298,8 @@ EOTEXT
       // no error means hg log found a bookmark
       if (!$err) {
         echo phutil_console_format(
-          "Bookmark name {$proposed_name} already exists; trying a new name.\n"
-        );
+          "Bookmark name %s already exists; trying a new name.\n",
+          $proposed_name);
         continue;
       } else {
         $bookmark_name = $proposed_name;
@@ -870,8 +869,7 @@ EOTEXT
       }
       $ok = phutil_console_confirm(
         "{$issue} Still try to apply the patch?",
-        $default_no = false
-      );
+        $default_no = false);
       if (!$ok) {
         throw new ArcanistUserAbortException();
       }
@@ -931,8 +929,7 @@ EOTEXT
           "This diff is against commit {$bundle_base_rev_str}, but the ".
           "commit is nowhere in the working copy. Try to apply it against ".
           "the current working copy state? ({$source_base_rev_str})",
-          $default_no = false
-        );
+          $default_no = false);
         if (!$ok) {
           throw new ArcanistUserAbortException();
         }
@@ -979,8 +976,7 @@ EOTEXT
       'differential.query',
       array(
         'commitHashes' => array($hash),
-      )
-    );
+      ));
 
 
     // grab the latest closed revision only
index be6dced3491449c112089d96c9ac011bb4836e6d..c5a9de5706ed1b54395bd0ce71b82403a9e3a569 100644 (file)
@@ -234,8 +234,7 @@ EOTEXT
 
     $tasks = $conduit->callMethodSynchronous(
       'maniphest.find',
-      $find_params
-      );
+      $find_params);
     return $tasks;
   }