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
Apply some autofix linter rules

Summary: Self-explanatory

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10453
Fix linting for spacing around default parameter assignment in function/method declaration

Summary: Fix linting for spacing around default parameter assignment in function/method declaration so that `function foo($x = null) {}` is preferred in favor of `function foo($x=null) {}`.

Test Plan: Modified existing unit tests.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10429
Fix a typo

Summary: Self-explanatory.

Test Plan: Eyeball it

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10462
Allow classes/functions from a later version if they are used conditionally

Summary:
Fixes T5299. Currently, linting `src/future/http/HTTPSFuture.php` from rPHU will raise the following error:

```
   Error  (XHP31) Use Of PHP 5.3 Features
    This codebase targets PHP 5.2.3, but `curlfile` was not introduced until
    PHP 5.5.0.

             532       // use this "@" stuff.
             533
             534       if (class_exists('CURLFile')) {
    >>>      535         $file_value = new CURLFile((string)$tmp, $info['mime'], $info['name']);
             536       } else {
             537         $file_value = '@'.(string)$tmp;
             538       }
```

However, since this class is being used conditionally, it //should// be fine and no linter errors should be being raised.

Test Plan: Added a test case.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5299

Differential Revision: https://secure.phabricator.com/D10132
Fix PHP version check for function calls with static/variable functions

Summary: D10132 improved this check by eliminating some false postives, but assumes an `n_FUNCTION_CALL` always starts with `n_SYMBOL_NAME`. This is true for `f()`, but not true for `C::m()` or `$v()`.

Test Plan: Added and ran unit tests.

Reviewers: btrahan, joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D10467
Fix a typo

Summary: Minor styling fix.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10478
Remove a useless function from `ArcanistMergeConflictLinter`

Summary: This function doesn't achieve anything.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10477
Fix custom severity rules not being applied

Summary: It seems that `severity.rules` does not override the default linter severities set by the `ArcanistLinter` itself. This seems incorrect and counter-intuitive.

Test Plan: Created a `"severity.rules": { "(.*)": "disabled" }"` configuration and verified that it was being applied.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

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