Remove --background flag to prevent `arc` from hanging

Summary:
Ref T4281. A long time ago, we added a `--background` flag to let `arc lint` and `arc unit` run while you're typing a commit message, in some situations.

This code is only moderately beneficial and is way too complicated. Particularly, it has a long history of causing hangs (T4281, T2463), doesn't work on Windows, and is impossible to debug.

It's also running into a serious PHP bug with EAGAIN/EPIPE being indistinguishable that I haven't been able to find a reasonable workaround for in ~3-4 hours of trying.

All the pathways forward that I can see make this already-complex system more complex.

The major reason that this stuff is so complex is that the subprocess may need to prompt the user (notably, to apply patches from lint).

Instead, I'm going to simplify how `arc diff` interacts with `arc lint` and `arc unit`, so we can just fire-and-forget a background process, let it do as much work as it can without needing user input, and then pick up wherever it left off. This will be slightly less cool/magical, but it won't hang bizarrely and I will be able to debug it.

For now, simply remove the `--background` flag and behavior so `arc` works for everyone.

Test Plan: Ran `arc diff` to create this diff.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4281

Differential Revision: https://secure.phabricator.com/D10198
Make arcanist lint tests flexible about testcase formatting

Summary:
We currently require an exact number of "~" characters, but this is needless and error-prone.

Instead, allow any number larger than 3.

Test Plan:
  - Added meta test-case.
  - Ran `arc unit --everything`.

Reviewers: btrahan, thoughtpolice

Reviewed By: thoughtpolice

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D10251
[lint] Add HLint-based Haskell linter

Summary:
This adds a lint engine for `hlint`, which is the standard and most general Haskell lint tool around these days.

Signed-off-by: Austin Seipp <aseipp@pobox.com>

Test Plan: Install `hlint`, and run `arc unit`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Projects: #arcanist

Differential Revision: https://secure.phabricator.com/D10250
Don't parse separator tabs as part of the filename in Git diffs which affect files with spaces

Summary:
Fixes T5870. When a filename contains spaces, Git will add a "\t" at the end of the "---" and "+++" lines. We currently consume this and think we're reading a file called "blah blah\t".

Instead, parse it out as not part of the filename.

Test Plan: Added failing unit test and made it pass.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5870

Differential Revision: https://secure.phabricator.com/D10267
Schedule repository updates from `arc commit`, not just `arc land`

Summary: Ref T5926. We only pass Phabricator an update hint from `arc land`, not from `arc commit`.

Test Plan:
  - Ran `arc land` and `arc commit` with `--trace`, saw hints go over the wire.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5926

Differential Revision: https://secure.phabricator.com/D10324
Arcanist - potentially fix some Windows badness

Summary: Fixes T5914, maybs.

Test Plan: will ask users in T5914

Reviewers: chad, epriestley

Reviewed By: chad, epriestley

Subscribers: chad, bluehawk, epriestley, Korvin

Maniphest Tasks: T5914

Differential Revision: https://secure.phabricator.com/D10333
Improve "arc land" error message to mention SVN alternatives

Summary: Fixes T3813. This error message isn't very helpful in SVN; be more helpful.

Test Plan: Ran `arc land` in a Subversion repository, got a reasonable error message.

Reviewers: btrahan, asherkin

Reviewed By: asherkin

Subscribers: aran

Maniphest Tasks: T3813

Differential Revision: https://secure.phabricator.com/D7275
Fix `arc browse path:line`

Summary: Ref T5781. This was broken in some earlier changes in T5781.

Test Plan: Ran `arc browse README`, `arc browse README:10`.

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5781

Differential Revision: https://secure.phabricator.com/D10346
Allow lines to be specified as comma delimited number ranges for arc browse

Summary: Ref T5971. We lose validation of the line ranges, but I don't think that's a huge issue.

Test Plan: Ran `arc browse README`, `arc browse README:3`, and `arc browse README:3,6-7`

Reviewers: btrahan, epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5971

Differential Revision: https://secure.phabricator.com/D10352
Adjust py.test invocation per T5973

Summary: Fixes T5973

Test Plan: how does computer

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5973

Differential Revision: https://secure.phabricator.com/D10356
Don't run "flake8" via stdin

Summary: flake8 v2.2.3 (released Aug 25) broke this. Just drop the stdin stuff.

Test Plan: User confirmed in IRC that this resolves the issue.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D10358
Adding php -l linter

Summary: Adds a linter that checks php files for syntax errors using php -l

Test Plan:
Add a section to your .arclint file similar to:
```
"php": {
  "type": "php",
  "include": "(\\.php$)"
}
```

Then run arc lint on a php file with a syntax error.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, jacobwalker0814, Korvin

Differential Revision: https://secure.phabricator.com/D10370
fix typo in exception handling

Test Plan: brake .arcrc, see reasonable error.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D10379
Update `puppet-lint` linter

Summary: Update the `puppet-lint` linter to support the latest version (v1.0.1). This version allows a custom configuration file to be passed via `--config`, which brings this linter into line with other linters.

Test Plan: Update test cases to pass.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10384
phutil_utf8_shorten => PhutilUTF8StringTruncator

Summary: Ref T3307. Very easy

Test Plan: this very diff!

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T3307

Differential Revision: https://secure.phabricator.com/D10391
Pass conduit credentials down to children workflow

Summary:
Calling `arc patch` on a diff that's dependent on a different diff tries to patch the parent first.
To patch the parent a child workflow is created, and a conduit is passed down, but the credentials are not and it is not marked as authenticated.

Then when the child tries to get the commit message for the dependency, it checks isConduitAuthenticated() https://secure.phabricator.com/diffusion/ARC/browse/master/src/workflow/ArcanistPatchWorkflow.php;2c3268f03ed70d3221eb1642bIc99ebb39b12902e$800 and on failure pops up an interactive editor for the commit message.

Instead we just pass down the credentials to the childred and mark them as authenticated, so this is not a problem.

Test Plan: With two diffs where DA2 depends on DA1, run `arc patch --force --nobranch DA2` ... this no longer pops an interactive editor for the commit message for the dependency.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: hach-que, seshness, epriestley, Korvin

Maniphest Tasks: T5986

Differential Revision: https://secure.phabricator.com/D10381
restored --head support

Summary: the call to setHeadCommit() was accidentally placed in a `if ($background) {}` block, which was removed in 54bea94. This adds the removed call.

Test Plan: used --head, worked as expected

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10447
Make some strings in `ArcanistPhutilXHPASTLinter` translatable

Summary: `pht`ize some string in `ArcanistPhutilXHPASTLinter` so that they are translatable.

Test Plan: Not 100% sure that I am doing it right...

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10431
Add some missing function parameter typehints

Summary: Add some missing function parameter typehints to the `ArcanistPhutilXHPASTLinter` class.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10430
Add an XHPAST lint rule for empty block statements

Summary: Adds an XHPAST linter rule for empty block statements. Basically, if a block statement is empty then it is much neater if the opening (`{`) and closing (`}`) braces are adjacent. Maybe this is just my own personal preference, in which case we could reduce the default severity to `ArcanistLintSeverity::SEVERITY_DISABLED`.

Test Plan: Wrote unit tests. I had to modify a bunch of existing unit tests accordingly.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10434