1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-14 10:52:40 +01:00
Commit graph

275 commits

Author SHA1 Message Date
epriestley
d408a80ae1 Update "arc paste" for Toolsets
Summary: Ref T13490. More-or-less straightforward upgrade to modern calls.

Test Plan: Created and viewed pastes.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21104
2020-04-13 15:01:51 -07:00
epriestley
196f8f54ce Remove "backout", "close", "flag", "start", "stop", "time", and "revert" workflows
Summary: Ref T13490. These workflows don't seem worth the maintenance cost, see T13488 for discussion.

Test Plan: Grepped for methods which looked like they might only be called by these flows, only dug up the backout stuff.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21100
2020-04-13 07:09:49 -07:00
epriestley
21e80a635d Upgrade "arc download" to Toolsets
Summary:
Ref T13490. This is mostly straightforward.

  - Drop "--show" in favor of "--as -".
  - Drop support for 4+ year old "file.info" API.
  - Use modern stream-to-disk support so we get a real progress bar and don't need to buffer files into memory.

Test Plan: Downloaded various files, including large files.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21097
2020-04-12 16:18:03 -07:00
epriestley
076f7be484 Update "arc call-conduit" for Toolsets
Summary: Ref T13490. Fairly straightforward update.

Test Plan: Made various Conduit calls.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21096
2020-04-12 16:17:47 -07:00
epriestley
0f2e277cd9 Update "arc amend" for Toolsets
Summary: Ref T13490. Moves "arc amend" to Toolsets with modern ref/hardpoint code.

Test Plan: Ran "arc amend --show", "--revision", etc. Hit all the prompts and errors, probably?

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21095
2020-04-12 13:48:26 -07:00
epriestley
ff4c1e7c81 Add a "SymbolEngine" to support top-level ref resolution by symbol
Summary:
Ref T13490. I'm continuing to move toward modernizing "amend", which needs to load some objects by symbol at top level.

Add an API to support this.

Test Plan: Added an API caller to "arc inspect", ran it and hit the new code. Things seemed to work.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21094
2020-04-12 13:48:09 -07:00
epriestley
5fc50c226a Add some support code for printing refs to stdout
Summary: Ref T13490. Make terminal strings work more like HTML does in Phabricator, and make it easier to display refs.

Test Plan: Added some display code, ran `arc inspect` to hit it, saw a nice ref printed.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21093
2020-04-12 13:44:46 -07:00
epriestley
088b157444 Add ref lookup for username symbols
Summary:
Ref T13490. I'm attempting to update "arc amend", but it needs to fetch revision authors to raise an "amending a revision you don't own" error.

Support user-symbol resolution.

Along the way, this introduces some infrastructure for abstracting away iteration over a multi-page Conduit result set.

Test Plan:
  - Ran "arc inspect ..." for various "user(...)" queries.
  - Set page size to 3 and issued a general query, saw the future page it away properly.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21092
2020-04-12 13:42:51 -07:00
epriestley
1f18f25fa5 Add a "RevisionSymbolRef", revision commit messages, and make "--explore" recursive
Summary:
Ref T13490.

  - Support resolution of revision symbols into revision objects.
  - Align commit inspection better against commit symbols.
  - Make "arc inspect --explore" recursively load all object hardpoints.
  - Add a "commit message" hardpoint to "RevisionRef".

Test Plan: Used "arc inspect" to resolve commits and revisions. Used "--explore" to see the whole tree.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21091
2020-04-12 13:24:32 -07:00
epriestley
4cc05c377d Add a "CommitSymbolRef" for resolving symbolic commits into stable commit hashes
Summary:
Ref T13490. Frequently, we know the symbolic name of a commit (like "master") but need the immutable identifier for it (the commit hash).

Provide a Ref and Query for doing this lookup.

Test Plan: Ran `arc inspect symbol(...)` with various symbols, saw appropriate resolutions, nulls, or errors.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21090
2020-04-12 13:19:53 -07:00
epriestley
9a198ffcc5 Update "feature", "branch", and "bookmark" flows to report properly in "arc help"
Summary:
Ref T13490. These workflows are aliases of one another, which is a little silly, but currently all identify as "arc feature" in "arc help".

Straighten that out, at least.

Test Plan: Ran "arc help", "arc branch".

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21086
2020-04-12 13:16:07 -07:00
epriestley
ccd1ebb256 Port "arc prompts" from wilds and fix a path issue in shell completion
Summary:
Ref T13490. Bring "arc prompts" from "wilds" and hook it into the prompt in "arc shell-complete".

See D21069. Fix an issue where the shell hook tested for a path other than the path it writes to.

Test Plan: Ran "arc shell-complete" with no hook and got a prompt. Shell completed things. Ran "arc prompts shell-complete".

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21085
2020-04-11 10:43:05 -07:00
epriestley
fff2fc8bc9 Remove "RefQuery" and all "HardpointLoader" code
Summary: Ref T11968. "RefQuery" is now "HardpointEngine". "HardpointLoader" is now "HardpointQuery".

Test Plan: Grepped for affected symbols.

Maniphest Tasks: T11968

Differential Revision: https://secure.phabricator.com/D21083
2020-04-11 06:46:53 -07:00
epriestley
dc42f51cf7 Reroute all RefQuery callers to HardpointEngine
Summary:
Ref T11968. "arc browse", "arc branch", and "arc diff" currently may execute into the RefQuery engine. Reroute them to the HardpointEngine.

This removes older-generation "Ref" objects and renames the replacement "RefPro" objects to "Ref".

Test Plan: Ran "arc branch", "arc browse <various things>", "arc diff", searched for affected symbols.

Maniphest Tasks: T11968

Differential Revision: https://secure.phabricator.com/D21082
2020-04-11 06:46:23 -07:00
epriestley
9e72e4ed1d Bring "pro" browse queries from modern hardpoint code
Summary: Ref T11968. Merge the modern hardpoint queries and refs for the "browse" workflow as "pro" variations.

Test Plan: Ran `arc inspect browse(...)` for objects, paths, commits, and revisions.

Maniphest Tasks: T11968

Differential Revision: https://secure.phabricator.com/D21080
2020-04-10 08:05:24 -07:00
epriestley
8bb81217d5 Bring a "pro" WorkingCopyState ref to "master"
Summary:
Ref T11968. Continue bringing modern yield-based hardpoint code into "master" in the parallel "Pro" classtree.

Adds "working-copy(commit-hash)" as an inspectable ref.

Test Plan: Inspected working copy refs, saw them resolve revisions by commit hash and commit message.

Maniphest Tasks: T11968

Differential Revision: https://secure.phabricator.com/D21079
2020-04-10 06:16:37 -07:00
epriestley
adea2550f5 Introduce "arc inspect" and some of the new ref/hardpoint classes
Summary:
Ref T11968. Inches toward the new ref/hardpoint code by introducing the modern refs as "RefPro" objects and supporting an "arc inspect <object>" to load objects and hardpoints.

This doesn't impact any existing runtime behavior.

Test Plan: Ran "arc inspect [--all] commit(...)", got hardpoint queries and yield-based data fetching.

Maniphest Tasks: T11968

Differential Revision: https://secure.phabricator.com/D21078
2020-04-10 05:01:25 -07:00
epriestley
391c164313 Trivially update "arc branch/feature" and "arc browse" for Toolsets
Summary:
Ref T11968. Ref T13490. These are the workflows which currently use the intermediate-level hardpoint code (which made hardpoints formal, but didn't do the yield stuff).

Move toward updating them by doing some basic bookkeeping, with a few compatibility adjustments to the parent Workflow class.

Test Plan: Ran "arc branch" and "arc browse" with various arguments.

Maniphest Tasks: T13490, T11968

Differential Revision: https://secure.phabricator.com/D21074
2020-04-10 04:23:03 -07:00
epriestley
85141c4d90 Add new "Hardpoint" classes to support request parallelization
Summary:
Depends on D21070. Ref T11968. Adds "yield"-aware query classes for parallelizing service calls.

These will replace the similar (but not yield-aware) "Hardpoint" classes introduced previously. This is an API change but most of the old classes still exist and still do the same thing, just with more "yield" statements.

This just adds a bunch of new code with no callers and no API updates.

Test Plan: See future changes.

Maniphest Tasks: T11968

Differential Revision: https://secure.phabricator.com/D21071
2020-04-08 09:23:50 -07:00
epriestley
0b3cd39230 Update the "WorkingCopy" API and create a fallback "Filesystem" working copy
Summary:
Ref T11968.

  - Allow "WorkingCopy" objects to maintain an API object and update callers ("get...()" instead of "new...()").
  - Always generate a WorkingCopy object and a RepositoryAPI object.

Currently, code has to look like this:

```
$working_copy = ...
if ($working_copy) {
  $repository_api = ...
  if ($repository_api [instanceof ... ]) {
```

This is clunky. There's also no reason some "arc" commands can't run outside a VCS working directory without special-casing how they interact with the filesystem.

Conceptually, model the filesystem as a trivial VCS (which stores exactly one commit, always amends onto it, and discards history). Provide a trivial WorkingCopy and API for it.

(This change isn't terribly interesting on its own, but chips away at landing the new Hardpoint infrastructure.)

Test Plan: Ran `arc version`, `arc upgrade`.

Maniphest Tasks: T11968

Differential Revision: https://secure.phabricator.com/D21070
2020-04-08 09:22:43 -07:00
epriestley
33dc2fe819 Allow "phage" to print execution status on SIGINT
Summary: Ref T13490. The new Arcanist runtime supports workflow signal handling, but Phage isn't quite able to make use of it. Clean up the last few pieces so it can work.

Test Plan: Ran "phage", hit ^C, got status information.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21060
2020-04-06 11:09:43 -07:00
epriestley
32005f26a4 Move Phage to FuturePool
Summary: Ref T11968. Phage has another "sustained pool of Futures" use case, and needs some slight adjustments after Future API changes.

Test Plan: Ran `bin/phage status ...`, got a clean result instead of a JSON decoding failure.

Maniphest Tasks: T11968

Differential Revision: https://secure.phabricator.com/D21058
2020-04-05 05:56:21 -07:00
epriestley
099c2ae648 Introduce "FuturePool" to make it easier to manage an ongoing pool of futures
Summary:
Ref T11968. "FutureIterator" recently became non-rewindable, and starting a Future twice is now an error.

This complicates a handful of use cases where a mostly-constant pool of futures is maintained over a long period of time, notably in daemon overseers and repository pull daemons.

They previously relied on being able to do "new FutureIterator($futures)" to continue resolution of a list of futures from any state. This no longer works quite like it used to, since Futures generally may not belong to more than one iterator now (and this property is desirable).

Introduce "FuturePool", which maintains exactly one iterator but manages the small amount of glue around adding and removing Futures from it, destroying it if the pool empties, and rebuilding it if the pool fills.

Test Plan: See next change, which makes use of this.

Maniphest Tasks: T11968

Differential Revision: https://secure.phabricator.com/D21053
2020-04-03 12:05:09 -07:00
epriestley
66a6128239 Remove the "preg_quote()" lint rule and update the "__CLASS__" lint rule
Summary:
Depends on D21031. Ref T11968. This clears some lint with the word "Future", but is just a minor cleanup patch not really related to the main goal in that task.

We currently warn on `preg_quote()` with no second parameter, but this is valid and correct:

```
preg_match('('.preg_quote($x).')', ...)
```

This is the modern recommended style for this sort of expression, so the warning is often a false positive; drop it.

The "__CLASS__" warning looks for hard-coded class names in strings, but currently looks for them as a word anywhere in the string.

This is often a false positive and sometimes makes error messages or exceptions untranslatable. For example, translators can't do anything with this:

> Filesystem path "%s" does not exist.

...if it's written as:

> %s path "%s" does not exist.

...just because it happens to appear in the class "Filesystem". Some other classes, including "Future", suffer from this.

Even when the detection is correct, it's clunky and a mistake here (failing to update the class name in an error message) is unlikely to ever do any real damage.

Test Plan: Ran unit tests and `arc lint`.

Maniphest Tasks: T11968

Differential Revision: https://secure.phabricator.com/D21032
2020-03-06 09:14:10 -08:00
epriestley
1b97f8b408 Update "arc upload" for Toolsets
Summary: Ref T13490. This largely makes "arc upload" work, although the Future stuff is still a bit wonky. See T11968.

Test Plan: Ran "arc upload README.md", got an upload.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21030
2020-02-26 08:22:18 -08:00
epriestley
9cd72baae9 Update Phage for toolsets and restore library loading behaviors
Summary: Ref T13490. This makes the "phage" toolset work properly and updates external library behavior to match the "classic" behavior, except that "--library" is now supported.

Test Plan: Ran "phage remote" workflows.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21025
2020-02-23 09:30:53 -08:00
epriestley
ee66b15bd4 Port "arc upgrade" to Toolsets
Summary: Ref T13490. Allows "arc upgrade" to run through the new Toolsets infrastructure.

Test Plan: Ran "arc upgrade", although you can't upgrade feature branches so this can't be entirely tested until it hits "master".

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21006
2020-02-17 11:33:17 -08:00
epriestley
d3b77af8a5 Require "--" as an argument terminator when running noninteractively
Summary:
Depends on D21001. Ref T13490.

  - Require "--" to terminate arguments when running noninteractively.
  - Don't correct spelling when running noninteractively (we still suggest corrections).
  - Remove old "phage" wrapper script.
  - Fix an issue where "argv" could implicitly generate a parseable "--argv" flag.
  - Accept "--" as an argument terminator even when there is no argument list.
  - Update some strings to use more modern quoting style.
  - Make workflows decline to handle signals by default.
  - Allow "arc weld" to weld non-UTF8 files together.

Test Plan: Ran various commands. Welded non-UTF8 files.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21002
2020-02-16 09:16:51 -08:00
epriestley
db8419f19b Port "arc weld" and "arc anoid" to Toolsets workflows, plus minor fixes
Summary: Ref T13490. Update the "weld" workflow and the "anoid" workflow. Incorporates D20938.

Test Plan: Ran "arc weld". Ran "arc anoid".

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21001
2020-02-16 09:16:24 -08:00
epriestley
8cd79d38af Port "arc shell-complete" to Toolsets
Summary: Depends on D20996. Ref T13395. Ports the updated version of this workflow from "experimental".

Test Plan: Ran `arc shell-complete` to install the hook, then shell-completed commands.

Maniphest Tasks: T13395

Differential Revision: https://secure.phabricator.com/D20997
2020-02-14 09:16:46 -08:00
epriestley
70c6045c7f Update "arc alias" to modern workflows
Summary: Depends on D20993. Ref T13395. Merges the more-modern "alias" out of "experimental".

Test Plan: Defined and invoked aliases. This has some rough edges: notably, no easy list/delete flow.

Maniphest Tasks: T13395

Differential Revision: https://secure.phabricator.com/D20996
2020-02-14 09:16:18 -08:00
epriestley
0c6ae6bbcf Port "arc version" to Toolsets
Summary: Ref T13395. Depends on D20992. Run "arc version" as a modern workflow, not a classic workflow.

Test Plan: Ran "arc version".

Maniphest Tasks: T13395

Differential Revision: https://secure.phabricator.com/D20993
2020-02-14 09:15:58 -08:00
epriestley
cf9469e0d1 Port "arc liberate" to Toolsets
Summary: Ref T13395. Depends on D20991. Make "arc liberate" run as a toolset command, not a classic command.

Test Plan: Ran "arc liberate"; created this diff.

Maniphest Tasks: T13395

Differential Revision: https://secure.phabricator.com/D20992
2020-02-14 09:14:56 -08:00
epriestley
0e95fcbb7f Port "arc help" to Toolsets
Summary: Ref T13395. Make "arc help" run as a toolset command, not a classic command.

Test Plan: Ran "arc help".

Maniphest Tasks: T13395

Differential Revision: https://secure.phabricator.com/D20991
2020-02-14 09:14:30 -08:00
epriestley
c471983697 Collapse Arcanist toolsets from "wilds" into "master", as an overlay layer
Summary:
Depends on D20988. Ref T13395. Ref T13098. Ref T13203.

This brings all the "toolsets" code into "master". We try to run commands as toolsets commands first, then fall back to older code.

Since the "toolsets" class tree is mostly parallel to the older class tree, this isn't completely broken. Currently, all commands fall back.

Test Plan: Created this diff, ran various other commands. But this is probably a long shot from finished.

Maniphest Tasks: T13395, T13203, T13098

Differential Revision: https://secure.phabricator.com/D20990
2020-02-13 14:10:46 -08:00
epriestley
acf0607683 Merge utility/support changes from "wilds" to "master"
Summary:
Ref T13395. Merge a lot of stuff which doesn't break existing workflows:

    - Merge a UTF8 fix for "cmd.exe" on Windows.
    - Merge minor changes to JSON linters.
    - Merge some shell completion stuff.
    - Merge some "arc anoid" fixes.
    - Merge various Windows improvements to unit tests which interact with processes / the filesystem.
    - Merge some other Windows path fixes.
    - Merge a UTF8 character class fix.
    - Merge script initialization.
    - Merge unit test support scripts.
    - Merge some initialization code.
    - Merge Windows stdout/stderr-as-files code.
    - Merge a bunch of code for making exec tests work on Windows.
    - Merge more Windows unit test fixes.
    - Merge "continue on failure" mode when loading symbols.
    - Merge "GPC" order CLI fixes.

Test Plan: Ran `arc unit --everything`; created this change. There's likely some less-than-perfect code here.

Maniphest Tasks: T13395

Differential Revision: https://secure.phabricator.com/D20988
2020-02-13 14:10:09 -08:00
epriestley
8c4f6ce161 Merge the remainder of the "experimental" branch
Summary:
Depends on D20986. Ref T13395. This //mostly// collapses the entire "experimental" branch into "master".

I plan to change the "Ref/Hardpoint" pattern to become future oriented, but this is more steps forward than sideways.

Test Plan: Ran various `arc` workflows.

Maniphest Tasks: T13395

Differential Revision: https://secure.phabricator.com/D20987
2020-02-13 06:05:08 -08:00
epriestley
61e059984a Merge "phage" from "experimental"
Summary: Ref T13395. Currently, "phage" is required for various cluster operations. Bring the working code out of "experimental". This isn't the final form; "wilds" has a fancier version.

Test Plan: Ran phage workflows against the cluster.

Maniphest Tasks: T13395

Differential Revision: https://secure.phabricator.com/D20982
2020-02-12 15:53:23 -08:00
epriestley
9b74cb4ee6 Fully merge "libphutil/" into "arcanist/"
Summary: Ref T13395. Moves all remaining code in "libphutil/" into "arcanist/".

Test Plan: Ran various arc workflows, although this probably has some remaining rough edges.

Maniphest Tasks: T13395

Differential Revision: https://secure.phabricator.com/D20980
2020-02-12 15:17:38 -08:00
epriestley
da6d4f85ee Add a lint check for deprecated argument order to "implode()"
Summary:
Ref T13428. Historically, "implode()" accepts arguments in either order. PHP 7.4+ warns about glue not being first.

Add a lint check when the second parameter is a static scalar, implying it is the glue parameter.

Test Plan: Ran unit tests. See next change.

Maniphest Tasks: T13428

Differential Revision: https://secure.phabricator.com/D20857
2019-10-17 09:09:08 -07:00
epriestley
f6b8480adc Implement "Warn When Landing" behavior for Build Plans in Arcanist
Summary:
Ref T13258. This makes "arc land" respect the new "Warn When Landing" behavior.

This will only work if you have very up-to-date APIs. Just fall back to the older code if the new API calls fail.

Test Plan: Ran `arc land` on a revision with builds in various states and with the different "Warn When Landing" behaviors. Saw appropriate warnings.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13258

Differential Revision: https://secure.phabricator.com/D20236
2019-03-06 06:47:53 -08:00
epriestley
25c2381959 Statically detect "continue" inside "switch"
Summary: See 30 prior patches. This is a fatal in PHP7, let's just hunt these down.

Test Plan: Ran unit tests. See next diff for results.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D19931
2018-12-28 00:01:12 -08:00
epriestley
d581c453b8 Allow diff generation via ArcanistBundle to be limited to an approximate maximum byte size
Summary:
Ref T13137. See PHI592. When you have a diff with 600MB of videos, we want to bail out of diff generation early (as soon as we realize what we're dealing with), not build an 800MB text diff in memory and then throw it away.

Support bailout //during// diff generation once we realize we're in over our heads.

This is approximate, but since the limit is fairly large (512KB by default) it isn't too important to be precise.

Test Plan: Rigged some callers to set various byte limits, generated diffs including diffs with large binaries. Got an appropriate diff or exeception depending on how low the limit was.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13137

Differential Revision: https://secure.phabricator.com/D19444
2018-05-14 09:09:06 -07:00
epriestley
be1dd7e2ba Robustly fuse files together with arc weld
Summary: Fixes T8236. I played around with a lot of variations of this but in the end it felt like the simple version was best.

Test Plan: Ran `arc weld a.txt b.txt`, observed very robust fusion of materials.

Maniphest Tasks: T8236

Differential Revision: https://secure.phabricator.com/D19081
2018-02-13 15:15:36 -08:00
epriestley
c784b56920 Make "arc land" accommodate a minor API change in Harbormaster build statuses
Summary:
See PHI261. Currently "arc land" shows every build staus (passed, failed, building, etc) as yellow. Intended behavior is that passed builds are green, failed builds are red, and so on.

This is because of an unintended API change a while ago in D16356. Since the only impact was a cosmetic color issue, this escaped notice until now.

Additionally, try to use the modern `harbormaster.build.search` if it is available.

Test Plan:
  - Ran `arc land` with running builds, got reasonable coloration.
  - Faked the new method not being available, still got sensible behavior from the old method.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D18837
2017-12-23 11:39:19 -08:00
epriestley
be67df6118 Extract and cover the logic for "trimming" a lint message
Summary:
Ref T9846. Sometimes, a lint message says to replace "the big bad wolf" with "the huge bad wolf": that is, the original and replacement text are the same at the beginning, or the end, or both.

To make this easier for humans to understand, we want to just show that "big" is being replaced with "huge", not that the entire phrase is being replaced.

This logic currently happens inline in console rendering. Pull it out and cover it so a future change can simplify console rendering.

Test Plan: Ran unit tests.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9846

Differential Revision: https://secure.phabricator.com/D18509
2017-08-31 13:28:01 -07:00
epriestley
ab0d81bca2 Add basic test coverage for lint console rendering
Summary: Ref T9846. The algorithm here is fairly invovled, so lay down some test coverage before breaking it.

Test Plan: Ran tests.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9846

Differential Revision: https://secure.phabricator.com/D18508
2017-08-31 13:27:44 -07:00
Asher Baker
836768bdcc Fix ArcanistPHPCloseTagXHPASTLinterRule always bailing out
Summary:
D13794 changed ArcanistPHPCloseTagXHPASTLinterRule to ignore inline HTML blocks, but selectDescendantsOfType returns an AASTNodeList (which always exists).

Instead, check that the count() of the node list is > 0.

empty.lint-test had to be changed, it wouldn't have been accepted had this rule not been broken before it was commited.

Added tests to cover ArcanistPHPCloseTagXHPASTLinterRule in the future.

Test Plan: `arc unit`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D18271
2017-07-22 03:48:37 +01:00
epriestley
06c641f92c Remove command spelling correction from Arcanist
Summary: Fixes T7489. Depends on D16332, which moved this code to libphutil.

Test Plan:
```
$ arc banch --bystatus
(Assuming 'banch' is the British spelling of 'branch'.)
(Assuming '--bystatus' is the British spelling of '--by-status'.)
...
```

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7489

Differential Revision: https://secure.phabricator.com/D16333
2016-07-27 09:35:28 -07:00
epriestley
c13e5a6295 Use an HTTPEngineExtension to implement "https.blindly-trust-domains" in Arcanist
Summary: Ref T10227. This converts weird hard-codey magic to the new HTTPEngineExtension.

Test Plan: See D16090.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10227

Differential Revision: https://secure.phabricator.com/D16091
2016-06-09 12:02:15 -07:00