Page MenuHomePhabricator

Return `$this` from setter methods
ClosedPublic

Authored by joshuaspence on Jun 25 2015, 8:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 2:27 AM
Unknown Object (File)
Fri, Apr 5, 7:17 AM
Unknown Object (File)
Thu, Mar 28, 9:26 PM
Unknown Object (File)
Thu, Mar 28, 1:44 PM
Unknown Object (File)
Mar 21 2024, 1:00 PM
Unknown Object (File)
Mar 18 2024, 1:01 AM
Unknown Object (File)
Mar 17 2024, 8:40 PM
Unknown Object (File)
Mar 16 2024, 6:09 PM
Subscribers

Details

Summary

Return $this from a bunch of setter methods for consistency. See also D13422.

Test Plan

Eyeball it.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Return `$this` from setter methods.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.

Any errors on your side to provide a clue why the unit test results failed to upload?

This revision is now accepted and ready to land.Jun 25 2015, 11:37 AM

Hmm, nope... this is what I saw on my end:

Linting...
 LINT OKAY  No lint problems.
Running unit tests...
   PASS  152ms   ArcanistBritishTestCase::testCommandCompletion
   PASS   81ms   ArcanistBritishTestCase::testArgumentCompletion
   PASS  289ms   ArcanistLibraryTestCase::testLibraryMap
   PASS   4.3s   ArcanistLibraryTestCase::testMethodVisibility
   PASS  183ms   ArcanistLibraryTestCase::testEverythingImplemented
   PASS  128ms   ArcanistXHPASTLintNamingHookTestCase::testStripUtilities
   PASS  153ms   ArcanistXHPASTLintNamingHookTestCase::testCaseUtilities
   PASS  167ms   ArcanistXHPASTLinterRuleTestCase::testLoadAllRules
   PASS  275ms   ArcanistChmodLinterTestCase::testLinter
   PASS   1.0s   ArcanistCSSLintLinterTestCase::testLinter
   PASS  205ms   ArcanistCSSLintLinterTestCase::testVersion
   PASS   92ms   ArcanistClosureLinterTestCase::testVersion
   PASS  300ms   ArcanistClosureLinterTestCase::testLinter
   PASS   4.8s   ArcanistCoffeeLintLinterTestCase::testLinter
   PASS  257ms   ArcanistCoffeeLintLinterTestCase::testVersion
   PASS  106ms   ArcanistCppcheckLinterTestCase::testVersion
   PASS  563ms   ArcanistCppcheckLinterTestCase::testLinter
   PASS   82ms   ArcanistCpplintLinterTestCase::testVersion
   SKIP  ArcanistCpplintLinterTestCase::testLinter
Unable to locate binary "cpplint" to run linter ArcanistCpplintLinter. You may need to install the binary, or adjust your linter configuration.
TO INSTALL: Install cpplint.py using `wget http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py`.
   PASS  207ms   ArcanistFlake8LinterTestCase::testVersion
   PASS  404ms   ArcanistFlake8LinterTestCase::testLinter
   PASS  192ms   ArcanistGoLintLinterTestCase::testLinter
   PASS   82ms   ArcanistGoLintLinterTestCase::testVersion
   SKIP  ArcanistHLintLinterTestCase::testVersion
Unable to locate binary "hlint" to run linter ArcanistHLintLinter. You may need to install the binary, or adjust your linter configuration.
TO INSTALL: Install hlint with `cabal install hlint`.
   SKIP  ArcanistHLintLinterTestCase::testLinter
Unable to locate binary "hlint" to run linter ArcanistHLintLinter. You may need to install the binary, or adjust your linter configuration.
TO INSTALL: Install hlint with `cabal install hlint`.
   FAIL  ArcanistJSHintLinterTestCase::testLinter
In 'jshint.lint-test', lint raised error on line 9 at char 0, but nothing was expected:

Unrecoverable syntax error. (100% scanned).

Actually raised:
  warning at line 3, char 8: W033 JSHintW033
  error at line 7, char 1: E019 JSHintE019
  error at line 9, char 0: E041 JSHintE041
   PASS  301ms   ArcanistJSHintLinterTestCase::testVersion
   PASS  18.5s   ArcanistJSONLintLinterTestCase::testLinter
   PASS  458ms   ArcanistJSONLintLinterTestCase::testVersion
   SKIP  ArcanistJscsLinterTestCase::testVersion
Unable to locate binary "jscs" to run linter ArcanistJscsLinter. You may need to install the binary, or adjust your linter configuration.
TO INSTALL: Install JSCS using `npm install -g jscs`.
   SKIP  ArcanistJscsLinterTestCase::testLinter
Unable to locate binary "jscs" to run linter ArcanistJscsLinter. You may need to install the binary, or adjust your linter configuration.
TO INSTALL: Install JSCS using `npm install -g jscs`.
   PASS  12.8s   ArcanistLesscLinterTestCase::testLinter
   PASS  396ms   ArcanistLesscLinterTestCase::testVersion
   PASS  507ms   ArcanistPEP8LinterTestCase::testLinter
   PASS  167ms   ArcanistPEP8LinterTestCase::testVersion
   PASS  582ms   ArcanistPhpLinterTestCase::testLinter
   PASS  134ms   ArcanistPhpLinterTestCase::testVersion
   PASS  515ms   ArcanistPhpcsLinterTestCase::testLinter
   PASS  140ms   ArcanistPhpcsLinterTestCase::testVersion
   SKIP  ArcanistPuppetLintLinterTestCase::testVersion
Unable to locate binary "puppet-lint" to run linter ArcanistPuppetLintLinter. You may need to install the binary, or adjust your linter configuration.
TO INSTALL: Install puppet-lint using `gem install puppet-lint`.
   SKIP  ArcanistPuppetLintLinterTestCase::testLinter
Unable to locate binary "puppet-lint" to run linter ArcanistPuppetLintLinter. You may need to install the binary, or adjust your linter configuration.
TO INSTALL: Install puppet-lint using `gem install puppet-lint`.
   PASS  324ms   ArcanistPyFlakesLinterTestCase::testLinter
   PASS  166ms   ArcanistPyFlakesLinterTestCase::testVersion
   PASS  937ms   ArcanistPyLintLinterTestCase::testLinter
   PASS  255ms   ArcanistPyLintLinterTestCase::testVersion
   SKIP  ArcanistRuboCopLinterTestCase::testVersion
Unable to locate binary "rubocop" to run linter ArcanistRuboCopLinter. You may need to install the binary, or adjust your linter configuration.
TO INSTALL: Install RuboCop using `gem install rubocop`.
   SKIP  ArcanistRuboCopLinterTestCase::testLinter
Unable to locate binary "rubocop" to run linter ArcanistRuboCopLinter. You may need to install the binary, or adjust your linter configuration.
TO INSTALL: Install RuboCop using `gem install rubocop`.
   PASS  576ms   ArcanistRubyLinterTestCase::testLinter
   PASS  121ms   ArcanistRubyLinterTestCase::testVersion
   PASS  226ms   ArcanistFilenameLinterTestCase::testLinter
   PASS  216ms   ArcanistGeneratedLinterTestCase::testLinter
   PASS   3.7s   ArcanistJSONLinterTestCase::testLinter
   PASS  174ms   ArcanistMergeConflictLinterTestCase::testLinter
   PASS  221ms   ArcanistNoLintLinterTestCase::testLinter
   PASS   1.3s   ArcanistPhutilXHPASTLinterTestCase::testLinter
   PASS  468ms   ArcanistSpellingLinterTestCase::testLinter
   PASS   94ms   ArcanistSpellingLinterTestCase::testFixLetterCase
   PASS  644ms   ArcanistTextLinterTestCase::testLinter
   PASS  2m58s   ArcanistXHPASTLinterTestCase::testLinter
   FAIL  ArcanistXMLLinterTestCase::testLinter
In 'attr2.lint-test', expected lint to raise error on line 1 at char 2, but no error was raised. Actually raised:
  error at line 2, char 1: XML73 LibXML Error
  error at line 2, char 1: XML65 LibXML Error
  error at line 2, char 1: XML40 LibXML Error
   FAIL  PhpunitTestEngineTestCase::testSearchLocations
Assertion failed, expected values to be equal (at PhpunitTestEngineTestCase.php:39).
Expected vs Actual Output Diff
--- Old Value
+++ New Value
@@ -1,29 +1,21 @@
 Array
 (
     [0] => /path/to/some/file/
-    [1] => /path/to/some/file/tests/
-    [2] => /path/to/some/file/Tests/
-    [3] => /path/to/some/tests/
-    [4] => /path/to/some/Tests/
-    [5] => /path/to/tests/
-    [6] => /path/to/Tests/
-    [7] => /path/tests/
-    [8] => /path/Tests/
-    [9] => /tests/
-    [10] => /Tests/
-    [11] => /path/to/tests/file/
-    [12] => /path/to/Tests/file/
-    [13] => /path/tests/some/file/
-    [14] => /path/Tests/some/file/
-    [15] => /tests/to/some/file/
-    [16] => /Tests/to/some/file/
-    [17] => /path/to/some/tests/file/
-    [18] => /path/to/some/Tests/file/
-    [19] => /path/to/tests/some/file/
-    [20] => /path/to/Tests/some/file/
-    [21] => /path/tests/to/some/file/
-    [22] => /path/Tests/to/some/file/
-    [23] => /tests/path/to/some/file/
-    [24] => /Tests/path/to/some/file/
+    [1] => /path/to/some/tests/
+    [2] => /path/to/some/Tests/
+    [3] => /path/to/tests/file/
+    [4] => /path/to/Tests/file/
+    [5] => /path/tests/some/file/
+    [6] => /path/Tests/some/file/
+    [7] => /tests/to/some/file/
+    [8] => /Tests/to/some/file/
+    [9] => /path/to/some/tests/file/
+    [10] => /path/to/some/Tests/file/
+    [11] => /path/to/tests/some/file/
+    [12] => /path/to/Tests/some/file/
+    [13] => /path/tests/to/some/file/
+    [14] => /path/Tests/to/some/file/
+    [15] => /tests/path/to/some/file/
+    [16] => /Tests/path/to/some/file/
 )
 

   PASS   93ms   PhutilUnitTestEngineTestCase::testPass
   PASS   94ms   PhutilUnitTestEngineTestCase::testTryTestMap
   PASS  128ms   PhutilUnitTestEngineTestCase::testGetTestPaths
   PASS  117ms   PhutilUnitTestEngineTestCase::testFailSkip
   PASS   94ms   PhutilUnitTestEngineTestCase::testTryTestCases

COVERAGE REPORT
      0%     src/unit/engine/XUnitTestEngine.php
      1%     src/configuration/ArcanistConfigurationManager.php
      1%     src/unit/engine/NoseTestEngine.php
     80%     src/lint/linter/xhpast/ArcanistXHPASTLinterRule.php
 UNIT ERRORS  Unit testing raised errors!


Unit test results include failures! Provide explanation to continue or press
Enter to abort.

    Explanation: Unrelated
 PUSH STAGING  Pushing changes to staging area...
Counting objects: 13, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (13/13), 1.06 KiB | 0 bytes/s, done.
Total 13 (delta 12), reused 0 (delta 0)
To ssh://dweller@secure.phabricator.com/diffusion/STAGING/staging.git
 * [new tag]         644520c6453960b47e128df9c168071d1a9395bb -> phabricator/diff/32505
 STAGING PUSHED  Pushed a copy of the changes to tag "phabricator/diff/32505" in the staging area.
Updating commit message...
Created a new Differential revision:
        Revision URI: https://secure.phabricator.com/D13423

Included changes:
  M       src/configuration/ArcanistConfigurationManager.php
  M       src/lint/linter/xhpast/ArcanistXHPASTLinterRule.php
  M       src/unit/engine/NoseTestEngine.php
  M       src/unit/engine/XUnitTestEngine.php

Thanks, I'll see what I can come up with.

This revision was automatically updated to reflect the committed changes.