Summary:
"Branch" was pluralized as "branchs".
Fixes T9225.
Test Plan:
* Created test repo with two revisions on a feature branch.
* Saw old message, frowned a little.
* Applied patch.
* No longer frowning.
Reviewers: chad, epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: avivey, Korvin
Maniphest Tasks: T9225
Differential Revision: https://secure.phabricator.com/D13944
Summary: Removed excess quotations on the `--msg-template` option as it was interfering with the string-int coercion
Test Plan: Unsure
Reviewers: joshuaspence, epriestley, #blessed_reviewers
Reviewed By: joshuaspence, epriestley, #blessed_reviewers
Subscribers: joshuaspence, e-m-albright, Korvin
Maniphest Tasks: T9214
Differential Revision: https://secure.phabricator.com/D13931
Summary: Adds a basic linter for ensuring that `composer.lock` files are up-to-date.
Test Plan: We have been using this in a private project for around a month.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: johnny-bit, Korvin
Differential Revision: https://secure.phabricator.com/D13883
Summary: Currently, linting PHP short array syntax (i.e. `[...]`) throws an exception ("Expected open parentheses"). This diff relaxes some restrictions which prevent short array syntax from linting with `ArcanistParenthesesSpacingXHPASTLinterRule`.
Test Plan: Modified test cases.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: agenticarus, Korvin
Differential Revision: https://secure.phabricator.com/D13895
Summary: Improve `ArcanistInlineHTMLXHPASTLinterRule` such that it doesn't raise duplicate warnings. Also be a bit more lax with whitespace.
Test Plan: Unit tests now pass.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin
Differential Revision: https://secure.phabricator.com/D13896
Summary: Ref T7409. Global variables are gross and should be avoided like the plague.
Test Plan: Added test cases.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin
Maniphest Tasks: T7409
Differential Revision: https://secure.phabricator.com/D13882
Summary: Add a linter rule to prevent trailing commas in a list assignment. `list($x, $y,)` is equivalent to `list($x, $y)`, but the latter is cleaner and should be preferred.
Test Plan: Added test cases.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin
Differential Revision: https://secure.phabricator.com/D13870
Summary:
Fixes T9029
See T9029 for more details, but basically at some point phutil_console_confirm
(which takes a `$default_no` parameter) was refactored to `$console->confirm()`
which takes a `$default` parameter with semantics negated..
Test Plan:
Run `arc lint` on a repository where patch is suggested. Default
option should be "[Y/n]" to accept the patch.
Reviewers: joshuaspence, #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley
Maniphest Tasks: T9029
Differential Revision: https://secure.phabricator.com/D13873
Summary: This is a test case for `ArcanistXHPASTLinter`, not `ArcanistPhutilXHPASTLinter`.
Test Plan: `arc unit`
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin
Differential Revision: https://secure.phabricator.com/D13866
Summary: This was broken in D13573.
Test Plan: Ran `arc unit --everything` in rPHU.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin
Differential Revision: https://secure.phabricator.com/D13864
Summary: Modify `ArcanistParenthesesSpacingXHPASTLinterRule` and `ArcanistCallParenthesesXHPASTLinterRule` to apply to `array()` and `list()` as well. Depends on D13858.
Test Plan: Added unit tests.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin
Differential Revision: https://secure.phabricator.com/D13859
Summary: This test case is failing on JSHint v2.8.0.
Test Plan: `arc unit`
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin
Differential Revision: https://secure.phabricator.com/D13860
Summary:
Ref T8096. Each test reports coverage information, which we sometimes merge into a combined coverage report.
Usually, each test will report results for every line in the file, so if the file is 30 lines long, coverage is usually 30 characters long.
However, for whatever reason, tests might report results for only the first part of the file. This is allowed and we handle it properly.
Right now, if one test reports 10 lines of results and another reports 30 lines of results, we only use the first 10 lines of results. Instead, extend the merged coverage to include the extra 20 lines of results.
(This is an uncommon case which I only hit because I was manually banging on my keyboard to generate test data, but there's no reason not to handle it better.)
Test Plan: Used web UI, added + executed unit tests.
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T8096
Differential Revision: https://secure.phabricator.com/D13854
Summary: Ref T5568. Use the `ArcanistConfigurationDrivenUnitTestEngine` automatically, if an `.arcunit` file exists. This behavior mimics the auto-detection for the configuration driven lint engine.
Test Plan:
Ran through the following scenarios:
- Ran `arc unit` and saw unit tests execute.
- Ran `arc unit --engine PhutilUnitTestEngine`
- Remove the `.arcunit` file and ran `arc unit`... got an exception.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin
Maniphest Tasks: T5568
Differential Revision: https://secure.phabricator.com/D13855
Summary:
This linter rule fails on multi-line arrays with no whitespace before the first array value. Specifically, the following exception is thrown:
```
Fatal error: Call to a member function isAnyWhitespace() on boolean in arcanist/src/lint/linter/xhpast/rules/ArcanistArrayValueXHPASTLinterRule.php on line 40
```
Test Plan: Added another test case.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin
Differential Revision: https://secure.phabricator.com/D13856
Summary: Add a linter rule to ensure that array elements occupy a single line each.
Test Plan: Added test cases.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin
Differential Revision: https://secure.phabricator.com/D13842
Summary: Ref T5568. As discussed in IRC. This is very rough and not widely useable, but represents a solid first step.
Test Plan: Ran `arc unit` with a bunch of flags.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: rfreebern, aripringle, jaydiablo, BYK, tycho.tatitscheff, epriestley, Korvin
Maniphest Tasks: T5568
Differential Revision: https://secure.phabricator.com/D13579
Summary: Use `PhutilClassMapQuery` instead of `PhutilSymbolLoader`, mainly for consistency. Depends on D13572.
Test Plan: This hasn't been tested very comphrehensively as of yet.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D13573
Summary:
Fixes T8674. Currently, `ArcanistSelfMemberReferenceXHPASTLinterRule` warns if a fully-qualified class name is used in place of `self`. This is fine in most cases, but in some specific scenarios fails for PHP 5.3 because `self` (and also `$this`) cannot be used in an anonymous closure (see [[http://php.net/manual/en/functions.anonymous.php | anonymous functions]] and [[https://wiki.php.net/rfc/closures/removal-of-this | removal of `$this` in closures]]).
In order to do this, I also had to modify the manner in which configuration was passed to individual linter rule. Previously, it was only possible or an individual linter rule to be set with a configuration value. Once the linter rule had set this value, there was no means by which to allow this value to be shared amongst linter rules.
Depends on D13819.
Test Plan: Added unit tests.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin
Maniphest Tasks: T8674
Differential Revision: https://secure.phabricator.com/D13820
Summary:
Improve `ArcanistUselessOverridingMethodXHPASTLinterRule` by allowing overriding methods which set default values. For example, the following scenario is perfectly valid:
```lang=php
class SomeClass {
public function __construct($x) {}
}
class SomeOtherClass extends Class {
public function __construct($x = null) {
parent::__construct($x);
}
}
```
Test Plan: Added test case.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin
Differential Revision: https://secure.phabricator.com/D13840
Summary: Ref T8674. Adds to `ArcanistPHPCompatibilityXHPASTLinterRule` such that an error is raised whenever `self` or `$this` is used in an anonymous closure prior to PHP 5.4.
Test Plan: Added test cases.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin
Maniphest Tasks: T8674
Differential Revision: https://secure.phabricator.com/D13841
Summary: Ref T8742. Anonymous functions should have a space after the `function` keyword. Additionally, ensure that there is a space before and after the `use` token.
Test Plan: Modified existing test cases.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin
Maniphest Tasks: T8742
Differential Revision: https://secure.phabricator.com/D13804
Summary: Unary postfix expressions should not have a space before the operator.
Test Plan: Added test case.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin
Differential Revision: https://secure.phabricator.com/D13805
Summary: Add a linter rule to check that there is no whitespace surrounding the object operator, `->`.
Test Plan: Added test case.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin
Differential Revision: https://secure.phabricator.com/D13798
Summary: Add a linter rule to ensure that there is no space between the operator and the operand in a unary prefix expression.
Test Plan: Added test cases.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin
Differential Revision: https://secure.phabricator.com/D13797
Summary: Repurpose `ArcanistClosingCallParenthesesXHPASTLinterRule` (and rename it to `ArcanistCallParenthesesXHPASTLinterRule`) to ensure that there is no spacing before opening parenthesis in function calls.
Test Plan: Added test case.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin
Differential Revision: https://secure.phabricator.com/D13796
Summary: Ref T7419. This makes it easier to render helpful documentation in the next diff without having to copy/paste things.
Test Plan:
In next diff:
{F688894}
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T7419
Differential Revision: https://secure.phabricator.com/D13788
Summary: Ref T8921. See similar change in D13695. This expands the scope to also coerce `setChar()`.
Test Plan: `arc unit --everything`
Reviewers: btrahan
Subscribers: epriestley
Maniphest Tasks: T8921
Differential Revision: https://secure.phabricator.com/D13737
Summary:
Fixes T8912. Property `$project_root` was missing in `PytestTestEngine` class, resulting in
broken py.test wrapper. Also renaming the property so the linter is happy.
Test Plan: `arc unit --everything`
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: kparal, epriestley, Korvin
Maniphest Tasks: T8912
Differential Revision: https://secure.phabricator.com/D13698
Summary: Fixes T8921. Harbormaster is strict about types it accepts, but `ArcanistLintMessage` is more liberal. Push the strictness barrier down to the linter level, while maintaining reasonable flexibility in the API.
Test Plan: `arc unit --everything`
Reviewers: btrahan, chad
Reviewed By: chad
Subscribers: epriestley
Maniphest Tasks: T8921
Differential Revision: https://secure.phabricator.com/D13695
Summary: "Advice" is not a valid severity for Checkstyle... valid severities are `ignore`, `info`, `warning` and `error`.
Test Plan: Read the [[http://checkstyle.sourceforge.net/property_types.html | documentation]].
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D13684
Summary: Improve `ArcanistClosingDeclarationParenthesesXHPASTLinterRule` (and rename it to `ArcanistDeclarationParenthesesXHPASTLinterRule`) to ensure that there is no whitespace before the opening parenthesis of a function/method declaration.
Test Plan: Added test cases.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D13675
Summary:
This is to fix `arc unit` when running a test file with no test results (e.g. skipped)
```
EXCEPTION: (RuntimeException) Undefined variable: last_test_finished at [<phutil>/src/error/PhutilErrorHandler.php:210]
arcanist(head=master, ref.master=d54cb072facd), deviantart(), phutil(head=master, ref.master=75f675747648)
#0 PhutilErrorHandler::handleError(integer, string, string, integer, array) called at [<arcanist>/src/unit/parser/ArcanistPhpunitTestResultParser.php:95]
#1 ArcanistPhpunitTestResultParser::parseTestResults(string, string) called at [<deviantart>/unit/DaUnitEngine.php:150]
#2 DaUnitEngine::parseTestResults(string, TempFile, string, string) called at [<deviantart>/unit/DaUnitEngine.php:82]
#3 DaUnitEngine::run() called at [<arcanist>/src/workflow/ArcanistUnitWorkflow.php:186]
#4 ArcanistUnitWorkflow::run() called at [<arcanist>/scripts/arcanist.php:382]
```
Test Plan: Create a test file with skipped tests. Run `arc unit`. Make sure the exception is not thrown.
Reviewers: joshuaspence, epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin, aurelijus
Differential Revision: https://secure.phabricator.com/D13640
Summary: Fixes T8805. Explicitly require int/float for duration. Adjust XUnit/Go parsers to provide one.
Test Plan: Ran unit tests.
Reviewers: btrahan, joshuaspence, chad
Reviewed By: chad
Subscribers: jsotuyod, champo, epriestley
Maniphest Tasks: T8805
Differential Revision: https://secure.phabricator.com/D13637
Summary:
Ref T8332. I find it really odd that I need to run `arc lint --everything --output xml > checkstyle.xml` and feel that it would be much more intuitive to just run `arc lint --everything --output xml` and have the output written to `checkstyle.xml`.
To provide context, we are running `arc lint --everything` in a CI job and parsing the results.
Test Plan: Ran `arc lint --everything --output xml` and saw the output written to file.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Maniphest Tasks: T8332
Differential Revision: https://secure.phabricator.com/D13570
Summary: I think that this output was used during the early stage of `ArcanistConfigurationDrivenLintEngine`, but I question it's value nowadays. In particular, I find that this output makes the output of `arc lint --trace` significantly less useful.
Test Plan: Ran `./bin/arc lint --trace` and saw useful output.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D13593
Summary: This host is no longer in service.
Test Plan: `git grep -i www.phabricator.com`
Reviewers: chad
Reviewed By: chad
Subscribers: epriestley
Differential Revision: https://secure.phabricator.com/D13586
Summary: Fixes T8714. When a test engine isn't returning the correct result type, shift suspicion onto it.
Test Plan: Faked error, got exception blaming test engine.
Reviewers: joshuaspence, btrahan
Reviewed By: btrahan
Subscribers: epriestley
Maniphest Tasks: T8714
Differential Revision: https://secure.phabricator.com/D13486
Summary:
Ref T8670. Ref T8657.
- When lint only has advice (no warnings/errors), consider it a "passing" build.
- Be a little louder about `sendmessage` calls failing because this stuff is not totally broken and that makes T8670-related things easier to catch/fix.
Test Plan: Created this revision.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Maniphest Tasks: T8657, T8670
Differential Revision: https://secure.phabricator.com/D13436
Summary: Return `$this` from a bunch of setter methods for consistency. See also D13422.
Test Plan: Eyeball it.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D13423
Summary: For consistency, a single space should separate `catch` and the following parenthetical expression.
Test Plan: Added test case.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D13389
Summary:
Ref T8095. Before uploading lint/unit results in the old way, try to ship them to autotargets.
If we can query and upload data to autotargets, do so, and then skip the older style uploads.
Test Plan: Used `arc diff` to ship data up via Harbormaster.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Maniphest Tasks: T8095
Differential Revision: https://secure.phabricator.com/D13381
Summary: Add some tests to ensure that `ArcanistXHPASTLinterRule` subclasses are properly implemented. This should catch issues such as two linter rules having the same `ID` value. See D13272 for a similar change.
Test Plan: `arc unit`
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D13274
Summary: All base classes should extend from `Phobject` or some other classes. See D13275 for some explanation.
Test Plan: `arc unit`
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D13281
Summary: If I understand correctly, all classes should extend from `Phobject`?
Test Plan: This needs some further work
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D13275
Summary: I found another issue with T8042... it seems that tests from the root directory (i.e. `src/__tests__` are not being discovered properly). The handling of this case (`$library_path` being the library root directory) can probably be improved, and I am open to suggestions. Depends on D13202.
Test Plan: Added to existing test cases.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D13185
Summary: Minor tidying of documentation and adding some groups.
Test Plan: Eyeball it.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D13135
Summary:
Ref T8042. Tests were not being discovered in two different scenarios:
# Files modified at the same level as the library root directory.
# "Normal" directories like `src/unit/engine`.
This regression was caused by D12689.
Test Plan: Added unit tests.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T8042
Differential Revision: https://secure.phabricator.com/D13126
Summary: Fixes T8374.
Test Plan:
```
$ arc diff
You have untracked files in this working copy.
Working copy: /Users/epriestley/dev/core/lib/arcanist/
Untracked changes in working copy:
(To ignore this change, add it to ".git/info/exclude".)
derp
Ignore this untracked file and continue? [y/N] ^C
```
Reviewers: btrahan, joshuaspence, chad
Reviewed By: chad
Subscribers: epriestley
Maniphest Tasks: T8374
Differential Revision: https://secure.phabricator.com/D13096
Summary:
The `ArcanistXHPASTLinter` class is becoming quite bloated. This diff separates the class into one-class-per-rule, which makes everything much more modular. One downside to this decoupling is that code reuse between linter rules is much more difficult, although this only affects a very small number of linter rules.
There is still some further work that could be done here, but I defer this until a later diff:
- Rewrite `ArcanistPhutilXHPASTLinter` using `ArcanistXHPASTLinterRule`.
- Change the unit tests so that they are truly only testing a single linter rule.
- Maybe improve the way in which linter configuration options are handled.
- Make it easier to keep track of the linter rule IDs (see T6859).
Test Plan: `arc unit`
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: johnny-bit, epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D10541
Summary: Fixes T8344. Prior to D12971, this always returned `array()`. It may now sometimes return `null`. Switch the behavior to be more similar to the old behavior.
Test Plan: Inspection.
Reviewers: btrahan, joshuaspence
Reviewed By: joshuaspence
Subscribers: epriestley
Maniphest Tasks: T8344
Differential Revision: https://secure.phabricator.com/D13061
Summary: Fixes T8042. Changes the way that `PhutilUnitTestEngine` discovers unit tests. In particular, if you only modify a single test case then there is no reason to run all other test cases within the same directory (which is the current behavior).
Test Plan: Added some unit tests.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Maniphest Tasks: T8042
Differential Revision: https://secure.phabricator.com/D12689
Summary: Ref T8238. If a staging area is configured for a repository (see D13019), push a copy of changes to it after creating a diff.
Test Plan: Ran `arc diff` with various options, saw applicable changes get pushed to staging.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: cburroughs, epriestley
Maniphest Tasks: T8238
Differential Revision: https://secure.phabricator.com/D13020
Summary: Fixes T8259. Depends on D13016. Use modern logic to support large file uploads.
Test Plan:
- Diffed with some images, saw them show up in the diff.
- Diffed with a 12MB binary, saw it upload in chunks.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Maniphest Tasks: T8259
Differential Revision: https://secure.phabricator.com/D13017
Summary:
Ref T8259. Currently, `arc upload` uses new logic but `arc diff` uses older logic internally. This prevents `arc diff` from uploading files larger than 4MB to newer servers.
Split the upload logic apart so the two upload pathways can share it. Callers now build a list of FileDataRefs and hand them to an Uploader for upload.
Test Plan:
Ran `arc upload` on:
- One file.
- Several files.
- Small files.
- Big files.
- Directories.
- Unreadable files.
- Files full of random data.
- The same file over and over again.
- The same big file over and over again.
- Artificially broke `file.allocate` and redid some of the simple cases (large/chunked aren't expected to work in this case).
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: joshuaspence, epriestley
Maniphest Tasks: T8259
Differential Revision: https://secure.phabricator.com/D13016
Summary:
Fixes T8314. Change the phutil_console_wrap() call to only have a single
string parameter.
Test Plan:
Ran `arc diff` added text into the title, summary and test plan fields,
but did not specify any reviewers. When prompted to continue, clicked 'No' and
saw the '(Message saved to commit message.)' string.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley
Maniphest Tasks: T8314
Differential Revision: https://secure.phabricator.com/D13015
Summary: Ref T7604. Remove "arcanist projects" from `ArcanistWorkingCopy` and a few other callsites. Depends on D12999.
Test Plan: Can't really think of how to test this.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley
Maniphest Tasks: T7604
Differential Revision: https://secure.phabricator.com/D12945
Summary: Ref T7604. Remove call to the `arcanist.projectinfo` #conduit endpoint from `ArcanistWorkflow`. Depends on D12992.
Test Plan: Ran `arc which` and verified that repository information was present.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley
Maniphest Tasks: T7604
Differential Revision: https://secure.phabricator.com/D12971
Summary:
Ref T7604. Ref T8307. This was broken in D12962 because I only tested `arc patch --arcbundle`. Furthermore, this particular sanity check doesn't actually do anything now (see T8307).
Test Plan:
Ran `arc patch --nobranch D12971` successfully.
Auditors: epriestley
Summary:
Ref T7604. Remove a call to `arcanist.projectinfo` from `arc export`. This Conduit call was only used to detect the repository encoding, which we should be able to do locally anyway.
I was considering removing the `$projectName` from `ArcanistBundle` as well, but I'm not convinved that this is a good idea. Specifically, doing so would make it difficult to issue the "This patch is for the 'X' project, but the working copy belongs to the 'Y' project" error. We could potentially use the repository callsign for this purposes, but this isn't portable across installs.
Test Plan: I'm not quite sure how to test this. I suspect that this functionality isn't widely used anyway.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T7604
Differential Revision: https://secure.phabricator.com/D12962
Summary: I found a few strings that I had missed, using a mostly-broken-but-somewhat-okay custom linter ruler (https://secure.phabricator.com/differential/diff/30988/).
Test Plan: Intense eyeballing.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: aurelijus, Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12888
Summary:
Currently, a lot of `ArcanistExternalLinter` subclasses have something like this:
```lang=php
if ($err && !$messages) {
return false;
}
```
We can avoid this code duplication by moving this check to the `ArcanistExternalLinter` class.
Test Plan: `arc unit`
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D11321
Summary: This allows `ArcanistBaseXHPASTLinter::getXHPASTTreeForPath` to return the parse tree for a file that wasn't explicitly linted. In my particular use case, I am writing a linter rule to determine if it is necessary to import a PHP file with `require_once` (i.e. the file consists only of class/interface definitions which are autoloadable).
Test Plan: Tested externally using a custom linter.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12271
Summary: Ref T7674. `ArcanistXHPASTLinter` has some workarounds for running in "commit hook" mode (which has since been removed). This linter should always have a working copy.
Test Plan: `arc unit`
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Maniphest Tasks: T7674
Differential Revision: https://secure.phabricator.com/D12956
Summary:
Removes the deprecated method of configuring linters (via the `.arcconfig` file). There is one main caveat here:
- There is currently no convenient method by which to change the path for an external linter (T5057). This means that there is no direct replacement for the deprecated `lint.ruby.prefix` configuration. The workaround is to symlink these binaries into `arcanist/externals/bin`.
Test Plan: Wait a sufficient amount of time before landing this.
Reviewers: chad, epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: aik099, epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D10005
Summary: Add some linter rule to detect invalid modifiers for class methods/properties.
Test Plan: Added test cases.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12922
Summary: Ref T7977. The `ArcanistTestCase` class is pointless and can be replaced by `ArcanistPhutilTestCase`. Furthermore, it sorta makes sense to just rename `ArcanistPhutilTestCase` to `PhutilTestCase`. Depends on D12664 and D12666.
Test Plan: `arc unit`
Reviewers: avivey, #blessed_reviewers, epriestley
Reviewed By: avivey, #blessed_reviewers, epriestley
Subscribers: aurelijus, Korvin, epriestley
Maniphest Tasks: T7977
Differential Revision: https://secure.phabricator.com/D12665
Summary:
Ref T7977. The `PhutilTestCase::getLink` method currently relies on arcanist projects instead of repositories. Instead, make this logic a bit smarter by looking up the base URI from `phabricator.uri` (currently it is hardcoded to `https://secure.phabricator.com`).
Ideally, we would pass `?repositories=$REPOSITORY_PHID` to `DiffusionSymbolController` as well, but I don't know if this is worth pursuing.
Test Plan: This diff.
Reviewers: avivey, #blessed_reviewers, epriestley
Reviewed By: avivey, #blessed_reviewers, epriestley
Subscribers: aurelijus, Korvin, epriestley
Maniphest Tasks: T7977
Differential Revision: https://secure.phabricator.com/D12664
Summary: Improve the `ArcanistXHPASTLinter::LINT_ALIAS_FUNCTION` linter rule. Currently this rule does not correctly handle alias functions which are not strictly lowercase.
Test Plan: Added a test case.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12921
Summary: Fixes T7417. Adds `ArcanistXHPASTLinter::LINT_MODIFIER_ORDERING` for ensuring that method/property modifiers (`public`, `protected`, `private`, `static`, `abstract` and `final`) are consistently ordered. The modifier ordering that is enforced is consistent with [[http://www.php-fig.org/psr/psr-2 | PSR-2]].
Test Plan: Added unit tests.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Maniphest Tasks: T7417
Differential Revision: https://secure.phabricator.com/D12421
Summary:
Improve the `ArcanistXHPASTLinter::LINT_ARRAY_SEPARATOR` rule to be able to autofix the following code:
```lang=php
array(
1,
2,
3, /* comment */ );
```
Test Plan: Added unit tests.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley
Differential Revision: https://secure.phabricator.com/D12308
Summary: Depends on D9430. If we are using the system installation of `pep8`, then it probably unnecessary (and possibly wrong) to specify `python2.6` as the default interpreter.
Test Plan: Ran `arc unit`.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: vrusinov, epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D9474
Summary: Currently, we bundle a specific version of `pep8` with Arcanist. Whilst maybe this made sense historically, as pointed out by @epriestley in D9412#6, there is no longer much point in doing so.
Test Plan: N/A
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: talshiri, vrusinov, Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D9430
Summary: This linter is a relic from Facebook days. As Harbormaster becomes more useful (T1049) this linter should become obsolete. Instead of modernising this linter to be compatible with modern infrastructure, it is easier to just let it die.
Test Plan: N/A
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D10533
Summary: Move the `getFunctionCalls` method to the `ArcanistBaseXHPASTLinter` so that it can be used by subclasses.
Test Plan: `arc unit`
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12472
Summary: Currently all CPPLint issues are hard-coded to warning level, which prevents customising the severity in .arclint. Change to pick up the configured severity. Note that getLintMessageSeverity will call getDefaultMessageSeverity if nothing is configured for that error category.
Test Plan: Tested manually to confirm configured categories display with the correct severity and that non-configured ones return with the default severity (ERROR).
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D9682
Summary: The `instanceof` operator expects the first argument to be an object instance. See http://www.phpwtf.org/instanceof-smart.
Test Plan: Added test case
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12856
Summary:
The `ArcanistXHPASTLinter::LINT_TOSTRING_EXCEPTION` linter rule was introduced in D12854, but fails for the following:
- Interfaces which declare the `__toString()` method.
- Classes which mark the `__toString()` method as `abstract`.
Test Plan: Added test cases.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12892
Summary:
See http://phpsadness.com/sad/39. Declaring a function named `__lambda_func` prevents the `create_function` function from working. This is because `create_function` eval-declares the function `__lambda_func`, then modifies the symbol table so that the function is instead named `"\0lambda_".(++$i)`, and returns that name.
NOTE: Personally, I don't think that anyone should use `create_function`. However, despite this, I think it is reasonable that no function is named `__lambda_func` in case some external library relies on `create_function`.
Test Plan: Added test case.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12870
Summary: Fixes T8207. It is not possible to throw an exception from within the `__toString()` method. Add a linter rule to prevent this from happening.
Test Plan: Added test cases.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Maniphest Tasks: T8207
Differential Revision: https://secure.phabricator.com/D12854
Summary: Currently the error message from `ArcanistXHPASTLinter::LINT_FORMATTED_STRING` is slightly wrong, mentioning `xsprintf` instead of the actual `sprintf`-style function which was used. This diff changes the error message to be more correct.
Test Plan: Linted a file containing `sprintf('%s')` and saw a reasonable lint message.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12871
Summary: This linter rule was introduced in D12420, but fails to handle a specific edge case.
Test Plan: Added test case.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12853
Summary: Ref T5655. After D9983, `ArcanistBaseWorkflow` and `ArcanistBaseUnitTestEngine` are deprecated.
Test Plan: Wait a sufficient amount of time before landing this.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Maniphest Tasks: T5655
Differential Revision: https://secure.phabricator.com/D10004
Summary: Ref T7409. This linter rule was added in D12419, but fails in some specific cases. Improve the handling of `n_DECLARATION_PARAMETER_LIST`.
Test Plan: Added unit tests.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T7409
Differential Revision: https://secure.phabricator.com/D12828
Summary: This lost formatting in a pht() conversion; give the bold back and make it properly translatable.
Test Plan: Will land.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Differential Revision: https://secure.phabricator.com/D12843
Summary: Refs D12607. Fixes T8195. Replace period in the sprintf() arguments with a comma.
Test Plan: Ran `arc diff` in the patch applied, did not get the sprintf() error
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley
Maniphest Tasks: T8195
Differential Revision: https://secure.phabricator.com/D12837
Summary:
The following code is invalid:
```
final class MyClass {
public function __construct() {
parent::__construct(null);
}
}
$x = new MyClass();
```
Running the above code will produce a fatal error:
```
PHP Fatal error: Cannot access parent:: when current class scope has no parent
```
Test Plan: Added unit tests.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12420
Summary:
Ref T2039. Convert the `ArcanistPylintLinter` to an `ArcanistExternalLinter` and make it compatible with `.arclint`. In doing so, it was necessary to drop support of older versions of `pylint` by setting the minimum version to be 1.0.0. I think that dropping support for older versions is reasonable because version 1.0.0 was released ~18 months ago. In the case than an incompatible version is detected, an `ArcanistMissingLinterException` is thrown.
One caveat here is that support for `lint.pylint.codes.(error|warning|advice)` is dropped. Any installs that are relying on this configuration will need to migrate to using the `.arclint` file for specifying linter severity. We could potentially continue to support this deprecated configuration, but I'm not sure if this is worthwhile.
Test Plan: Wrote and executed unit tests with `arc unit`. I ran the unit tests on all `pylint` releases after (and including) 1.0.0. Specifically, the tests were run on v1.0.0, v1.1.0, v1.2.0, v1.3.0 and v1.4.0.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Maniphest Tasks: T2039
Differential Revision: https://secure.phabricator.com/D9109
Summary: Use `__CLASS__` instead of hardcoding class names. Depends on D12804.
Test Plan: Eyeball it.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12805
Summary: Add a linter rule to advise against the use of hardcoded class names. Hardcoded class names make the code harder to refactor and it is generally preferable to use the `__CLASS__` magic constant instead.
Test Plan: This works, but needs some polish.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12605
Summary: Ref T8087. Prepares for eventually making these optional after T6030. See also T7443.
Test Plan:
- See the next change for the server-side part of this.
- With both patches applied, rigged the server to return `D123`.
- Created a revision, saw bare `D123`.
- Updated it with bare `D123`, things worked properly.
- Created this revision with full URIs.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: cburroughs, epriestley
Maniphest Tasks: T8087
Differential Revision: https://secure.phabricator.com/D12748
Summary:
Ref T5955. This logic is a little cleaner than the previous version.
Don't require `~/.arcrc` to exist if the caller provides `--conduit-token`.
Test Plan:
- Made calls with `--conduit-token` and no `~/.arcrc`.
- Made calls with `--conduit-token` and a normal `~/.arcrc`.
- Made calls with normal `arc`.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: mbishopim3, epriestley
Maniphest Tasks: T5955
Differential Revision: https://secure.phabricator.com/D12750
Summary:
The ArcanistPhpunitTestResultParser has been changed
to use phutil_json_decode instead of json_decode in
rARCa4d33ef117aa8702181154b60ce1ce52bcfc119b
That has broken the functionality as json_decode has returned
an object before but phutil_json_decode does return an array.
The code has now been adopted to work with the array result
instead of an object.
Test Plan: Run a phpunit test case
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: aurelijus, epriestley
Differential Revision: https://secure.phabricator.com/D12751
Summary: Fixes T6311 and T5124 by returning all configured linters from `buildLinter()`, and making `ArcanistExternalLinter::checkBinaryConfiguration()` not crash if there's no executable to run.
Test Plan: `arc linters` in rP shows "Configured" and "ERROR" as appropriate; Adding a broken linter to `.arclint` in rARC doesn't invoke it's not actually needed, and prints error if it is.
Reviewers: joshuaspence, epriestley, #blessed_reviewers
Reviewed By: joshuaspence, epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Maniphest Tasks: T6311
Differential Revision: https://secure.phabricator.com/D10773
Summary: Ref T5955. This makes it easier to write scripts which call Conduit via `arc call-conduit`.
Test Plan: Used `arc --conduit-token ... call-conduit user.whoami` to make calls as various users.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: mbishopim3, epriestley
Maniphest Tasks: T5955
Differential Revision: https://secure.phabricator.com/D12717
Summary: Support and prefer configuration from .arclint over Configuration Manager
Test Plan: arc lint with several combinations of values in .arcconfig and .arclint.
Reviewers: joshuaspence, epriestley, #blessed_reviewers
Reviewed By: joshuaspence, epriestley, #blessed_reviewers
Subscribers: vrusinov, jpoehls, Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D10704
Summary: Ref T7674. Remove support for passing data to linters via `STDIN`. This functionality exists primarily for pre-receive workflows (which don't have a working copy to act on), but these workflows are going away soon.
Test Plan: `arc unit`
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T7674
Differential Revision: https://secure.phabricator.com/D12696
Summary: Ref T7215. This test case is consistently failing locally (with a `LIBXML_VERSION` of `20902`).
Test Plan: `arc unit`
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Maniphest Tasks: T7215
Differential Revision: https://secure.phabricator.com/D12706
Summary: Remove the `ArcanistUncommittedChangesException` class which is unused after D11843.
Test Plan: `grep`
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12515
Summary: Move the `getSuperGlobalNames` method to `ArcanistBaseXHPASTLinter` so that it can be used within subclasses.
Test Plan: `arc unit`
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: virendra20888, Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12473
Summary: Ref T7892. Memoize paths returned from `ARcanistLinter::getPaths()` to improve runtime performance.
Test Plan: Wiped ~0.5 seconds off the total time to lint rARC.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Maniphest Tasks: T7892
Differential Revision: https://secure.phabricator.com/D12520
Summary: Ref T7892. Improve the performance of `ArcanistXHPASTLinter::LINT_UNNECESSARY_SEMICOLON`.
Test Plan: Wiped 6 seconds off the total time to lint rARC.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T7892
Differential Revision: https://secure.phabricator.com/D12519
Summary: Ref T7892. Avoid reading the PHP compatibility information for every file being linted.
Test Plan:
```name=Before
real 1m24.327s
user 1m19.571s
sys 0m5.239s
```
```lang=After
real 1m12.029s
user 1m5.756s
sys 0m5.502s
```
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Maniphest Tasks: T7892
Differential Revision: https://secure.phabricator.com/D12518
Summary:
Fixes T5097. When linting a large list of paths (e.g., with `--everything`), do this internally:
$chunks = array_chunk($paths, 32);
foreach ($chunks as $chunk) {
$this->lintChunk($chunk);
}
This keeps the advantages of parallelism and artifact sharing for future-based linters, without having memory usage grow in an unbounded way.
These callbacks changed:
- `willLintPath()`: Useless, no meaningful implementations. Internalized the required side effect and broke the hook.
- `didRunLinters()`: Now useless, with no meaningful implementations. Broke the hook.
- `didLintPaths()`: New hook which executes opposite `willLintPaths()`.
- `lintPath()`: Linters no longer need to implement this method.
XHPAST now has an explicit way to release shared futures.
These minor changes also happened:
- Formalized the "linter ID", which is a semi-durable identifier for the cache.
- Removed linter -> exception explicit mapping, which was unused. We now just collect exceptions.
- We do the `canRun()` checks first (and separately) now.
- Share more service call profiling code.
- Fix an issue where the test harness would use the path on disk, even if configuration set a different path.
Test Plan:
- Ran `arc lint --everything` in `arcanist/`.
- With no chunking, saw **unstable** memory usage with a peak at 941 MB.
- With chunk size 32, saw **stable** memory usage with a peak at 269 MB.
- With chunk size 8, saw **stable** memory usage with a peak at 180 MB.
- Ran with `--trace` and saw profiling information.
- Created this diff.
Reviewers: joshuaspence
Reviewed By: joshuaspence
Subscribers: epriestley
Maniphest Tasks: T5097
Differential Revision: https://secure.phabricator.com/D12501
Summary: The default Go Test Parser stopped showing the test function name at the end of the package after some Go upgrade. We fixed it locally and wanted to share it upstream.
Test Plan: We ran it on our test suite using go1.4.2 darwin/amd64. We have version-dependent code which cannot be compiled with earlier versions of Go, unfortunately.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: avivey, Korvin, epriestley
Maniphest Tasks: T7845
Differential Revision: https://secure.phabricator.com/D12436
Summary: `pht`ize a bunch of strings in `ArcanistXHPASTLinter`.
Test Plan: Eyeball it.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12392
Summary: Ref T7409. If `::` is surrounded by whitespace tokens and the whitespace token contains a newline character, allow it.
Test Plan: Added test case.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T7409
Differential Revision: https://secure.phabricator.com/D12391
Summary: Although these don't do any harm, they show up in my editor which is configured to highlight trailing whitespace.
Test Plan: Submitted this diff... saw no trailing whitespace.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12369
Summary: Improve `ArcanistXHPASTLinter::LINT_ARRAY_SEPARATOR` in handling multi-line arrays, see D12280 and D12281 for example. Depends on D12295.
Test Plan: Updated unit tests.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12296
Summary: Fixes T7464. JSHint is unable to exclude files from linting (via the `jshintignore` file) if the data is piped through `STDIN`. An alternative would be to pass `$options[] = '--filename='.$this->getActivePath()`, but `$this->getActivePath()` is not set when the command arguments are constructed.
Test Plan: Created a file and linted it with `ArcanistJSHintLinter`. Was able to exclude the file from linting with a `jshintignore` file.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Maniphest Tasks: T7464
Differential Revision: https://secure.phabricator.com/D12298
Summary: The format of this file has changed. Depends on D12278.
Test Plan: `arc unit`
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12279
Summary:
Ref T7409. Adds a rule to detect unnecessary semicolons. The most common scenario I've seen in the wild is the use of semicolons after a class definition:
```lang=php
class MyClass {
// ...
};
```
Test Plan: Added unit tests.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T7409
Differential Revision: https://secure.phabricator.com/D12139
Summary: Ref T5655. This class was deprecated in D11673.
Test Plan: Wait a few months.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T5655
Differential Revision: https://secure.phabricator.com/D11740
Test Plan:
Add the following JSON to your `.arclint`:
```lang=json
"rubocop": {
"type": "rubocop",
"include": "(\\.rb$)"
}
```
Then, add a ruby file with errors, for instance:
```lang=ruby
def hello()
puts 'world'
end
```
Run `arc lint`. It should come up with something along the line of: "Omit the parentheses in defs when the method doesn't accept any arguments."
Reviewers: joshuaspence, remon, #blessed_reviewers, epriestley
Reviewed By: joshuaspence, #blessed_reviewers, epriestley
Subscribers: reu, calfzhou, jjooss, cburroughs, chad, Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D10738
Summary:
Fixes T7521. This separates things into two prompts and doesn't try to automatically add untracked files.
This also fixes T7512, or at least I can't reproduce it after this change.
Test Plan:
- Ran `arc diff` in a `git` directory with untracked files.
- Ran `arc diff` in a `svn` directory with untracked files.
- Ran `arc diff` in a `hg` directory with untracked files.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Maniphest Tasks: T7512, T7521
Differential Revision: https://secure.phabricator.com/D12258
Summary:
Ref T7594. Currently, if a chunk upload fails, we incorrectly swallow the failure and fall back to single-file upload, which will often fail by hitting size limits. This also silences the original error.
Instead, do chunk uploads outside the block so that any exceptions escape, and we don't try to fall back to single-file upload.
Mostly just trying to get more info about what's going wrong on @joshuaspence's install.
Test Plan: Faked an exception in chunk upload, ran `arc upload` on a big file, saw the exception displayed on the console.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley, joshuaspence
Maniphest Tasks: T7594
Differential Revision: https://secure.phabricator.com/D12111
Summary: Ref T7149. Make sure we sit at "Resuming: 60%" or whatever while uploading the first chunk.
Test Plan: Ran `arc upload` on a large file, cancelled it, resumed it, got sensible progress bar.
Reviewers: chad, btrahan
Reviewed By: chad, btrahan
Subscribers: epriestley
Maniphest Tasks: T7149
Differential Revision: https://secure.phabricator.com/D12082
Summary: Ref T7149. This was just for testing and is no longer required.
Test Plan: `grep`
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Maniphest Tasks: T7149
Differential Revision: https://secure.phabricator.com/D12077
Summary: Ref T7149. This makes the client try to use the new `file.allocate` API before falling back to the old stuff.
Test Plan: Used `arc upload` to upload files. With chunking forced, uploaded chunked files.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: joshuaspence, epriestley
Maniphest Tasks: T7149
Differential Revision: https://secure.phabricator.com/D12061
Summary:
Refs D11990. When using `arc diff` with untracked files in the working
copy, add the untracked file(s) to the commit (as they weren't stashed or
ignored). Add the untracked paths to the list of changes in the editor
template, indicating that the files were added to the commit.
This doesn't add a separate prompt to add untracked files as per the
behaviour prior to D11843.
Test Plan:
Ran `arc diff` with only untracked files, answered yes to the 'create
new commit' prompt. Saw the commit-message with the updated changes
including untracked files. Completed the arc template, and got commit
containing uncommitted, unstaged and untracked files.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D11995
Summary: Fixes T7465. I think I just missed this when untangling the old logic.
Test Plan: Ran `arc diff` with //only// untrakced files, saw warning.
Reviewers: btrahan, chad
Reviewed By: chad
Subscribers: epriestley
Maniphest Tasks: T7465
Differential Revision: https://secure.phabricator.com/D11990
Summary:
We end up with one too few newline here in some workflows, like `arc land` with unstaged changes.
Root issue here is that `phutil_console_prompt|confirm` lead with too much whitespace but that's a harder fix.
Test Plan: Saw reasonable whitespace.
Reviewers: btrahan, chad
Reviewed By: chad
Subscribers: epriestley
Differential Revision: https://secure.phabricator.com/D11927
Summary: This is supposed to just print out the base revision, but actually prints out the repository section first.
Test Plan: Ran `arc which`, `arc which --show-base`.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Differential Revision: https://secure.phabricator.com/D11888
Summary:
Fixes T7344.
Currently, we use `phutil_console_prompt()`, which isn't a very good editor. Use the real $EDITOR instead.
100% of the logic here was also a gigantic mess. Clean it up.
Test Plan: Will update in a second with console output from this run.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Maniphest Tasks: T7344
Differential Revision: https://secure.phabricator.com/D11843
Summary:
Ref T7152. Ref T1139.
- Tweak API.
- Move translations out of __init__ file.
Test Plan:
- Ran `arc`.
- Added a goofy translation and made sure it was working.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Maniphest Tasks: T7152, T1139
Differential Revision: https://secure.phabricator.com/D11746
Summary: After all that, I forgot to change this back.
Test Plan: Eyeball it.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D11735
Summary:
pep8 has used both 2 (`1.2`) and 3 (`1.2.1`) digit versions. Losen
the version check to allow for both.
NOTE: This is the same regex as flake8.
Test Plan: `arc unit` with a 2 and 3 digit pep8 version on `$PATH`.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: joshuaspence, epriestley
Differential Revision: https://secure.phabricator.com/D11728
Summary: Fixes T7046. Adds a linter rule to detect mismatched parameters for formatted strings. Originally I had considered putting this rule in `ArcanistPhutilXHPASTLinter`, but I later decided to move it to `ArcanistXHPASTLinter` as I think that it is general enough to be more widely useful.
Test Plan: This seems to work but needs some polish.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Maniphest Tasks: T7046
Differential Revision: https://secure.phabricator.com/D11661
Summary: Ref T5655.
Test Plan: Ran `arc lint` with `lint.engine` set to `ComprehensiveLintEngine` and saw a deprecation notice.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley
Maniphest Tasks: T5655
Differential Revision: https://secure.phabricator.com/D11673
Summary: It should be safe to remove this now.
Test Plan: `arc unit`
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D11714
Summary: I don't think that this provides too much value. I think that we should rework this to be inferred from the `.arcconfig` file perhaps?
Test Plan: `arc unit`
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D11662
Summary: Fixes T7113. This one was a bit trickier than others as the API output changed a bit. In particular, there is no "errors" emitted so much as the result set just doesn't include the answer if things are garbage. Ergo, check the "identifier map" to either check for diff existence or to lookup the phid to grab the actual diff data from the "data" part of the result.
Test Plan: called `arc backout D11665` and got some working output...!
Reviewers: epriestley
Reviewed By: epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T7113
Differential Revision: https://secure.phabricator.com/D11667
Summary: Fixes T7112. Nothing too difficult here.
Test Plan:
meta - submitting this with the new arcanist code
used conduit API to verify the difference between getdiff (just the latest diff) and querydiffs (all diffs that match, with the latest diff first in the set)
Reviewers: epriestley
Reviewed By: epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T7112
Differential Revision: https://secure.phabricator.com/D11665
Summary:
Some commands (like `get-config`) do not require a working copy at all. Recent changes prevented these commands from running outside a VCS working copy.
Let `null` mean "no working copy".
See also <https://github.com/phacility/phabricator/issues/800>.
Test Plan:
- Ran `arc get-config` from outside a working copy.
- Ran `arc list` from outside a working copy, got an error.
- Ran `arc commit` in a Git working copy, got an error.
Reviewers: joshuaspence
Reviewed By: joshuaspence
Subscribers: epriestley
Differential Revision: https://secure.phabricator.com/D11643
Summary: Explicitly declare that the `arc branch` command is only supported under `git`.
Test Plan: N/A
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D11552
Summary: This workflow only works on git + mercurial.
Test Plan: I don't even subversion.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D11626
Summary: This workflow does not work on subversion.
Test Plan: N/A
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D11625
Summary: It doesn't make any sense to run this command on another VCS.
Test Plan: N/A
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D11624
Summary: It doesn't make any sense to run this command on any other VCS.
Test Plan: Ran `arc svn-hook-pre-commit` and hit the usage exception.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D11623