Change double quotes to single quotes.

Summary: Ran `arc lint --apply-patches --everything` over rPHU, mainly to change double quotes to single quotes where appropriate. These changes also validate that the `ArcanistXHPASTLinter::LINT_DOUBLE_QUOTE` rule is working as expected.

Test Plan: `arc unit --everything` and eyeballed the diff.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9184
Use the `ArcanistChmodLinter`.

Summary: Apply the `ArcanistChmodLinter` from D9187.

Test Plan: Removed all other linters from the `.arclint` file and executed `arc lint --everything`. Confirmed that there were no issues raised.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9189
Rebuild map

Summary: arc liberate src

Test Plan: n/a

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9218
Throw when passing array_mergev() non-array items

Summary: See rP481a2954545e for an example of the kind of error this can catch.

Test Plan: Ran unit tests.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D9213
Store daemon arguments in reference file.

Summary: Ref T4735. Store the arguments that were used to launch a daemon in the reference file. This will allow the daemon arguments to be echoed to the console for `./bin/phd status`.

Test Plan: See D9208.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T4735

Differential Revision: https://secure.phabricator.com/D9207
Add `%LR` support to `csprintf`.

Summary: Allow `csprintf` to format an array of readable strings.

Test Plan:
I didn't create any test cases because there aren't any existing test cases for `csprintf`. Instead, I used the following script:

```lang=php
<?php

require_once __DIR__.'/scripts/__init_script__.php';

echo csprintf('%LR', array('foo', '--not', 'bar'))."\n";
echo csprintf('%LR', array('foo', '--not bar'))."\n";
```

The output was as follows:

```
foo --not bar
foo '--not bar'
```

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9229
Allow `FileFinder` to find paths which match a given path exactly.

Summary: Ref T5105. This functionality is required in order to discover all `.editorconfig` files.

Test Plan: Wrote and executed unit tests.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5105

Differential Revision: https://secure.phabricator.com/D9295
Add `pygmentize` support for Puppet files.

Summary: A Puppet lexer was added to `pygmentize` in v1.6rc1. Apply the Puppet lexer to `*.pp` files.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9318
Don't redraw the console progress bar every time

Summary: lulululuul see D9361

Test Plan: derp derp derp

Reviewers: joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D9363
Fix lint when working on windows

Summary:
Fixes T4395.

Add quotes to ExecFuture strings on Windows to prevent `cmd.exe` from mucking up the command string.

Test Plan: Run `arc lint` on projects using `phpcs`. See everything working like it should.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T4592, T4395

Differential Revision: https://secure.phabricator.com/D9348
Allow triple backticks to be preceded by whitespace.

Summary: Fixes T5264. Allows triple backticks to be preceded by whitespace in a code block. This fixes the display of quoted code blocks, which are regular code blocks prefied with `> `.

Test Plan: Wrote and executed unit tests.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5264

Differential Revision: https://secure.phabricator.com/D9388
Implementation of PhutilLexer for Python

Summary: This appears to be ~1.5-2.0x faster than pygments on my machine, which isn't as good as I was hoping for but will help. (This is ~330 ms for a 4400-line file I chose at random.)

Test Plan: Loaded a Python paste and saw highlights that approximately (or maybe exactly) match the pygments version.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9370
Fix bugs in python lexer

Summary:
Two things:

- The appearance of \\ or \' or \-followed-by-a-newline in a raw string would improperly end the string
- A disallowed newline in a string would cause an error instead of trying to continue anyway

Test Plan:
Ran it on a file that was failing for me that was something like:

    x = r'\\"'
    # hello there

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9404
Apply various linter fixes.

Summary: Applied various linter fixes.

Test Plan: Ran `arc unit` to verify things still worked.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9435
Allow `Makefile` files to contain tabs.

Summary: Add an entry to the `.editorconfig` file to allow `Makefile` files to contains tabs over spaces. Without this entry, my editor will automatically convert the tabs to spaces (which `make` does not like).

Test Plan: Opened `./support/xhpast/Makefile` and saved it. Verified that spaces weren't converted to tabs.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9436
Exclude some test data from being linted.

Summary: Currently, `arc lint --apply-patches` will patch some files which contain test data, consequently causing unit tests to file. We should either modify the tests so that they can pass linting and unit tests successfully (if possible), or just exclude them from being linted.

Test Plan: Ran `arc lint --apply-patches` and ensured that these files were not patched.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9437
Support interactive editing with Windows editors

Summary: Currently, output is generated with *nix newlines (`\n`) but this doesn't work in (for example) notepad. (and oh, Notepad blocks just fine)

Test Plan: run `arc diff` with and without the patch. See a mess before, and beauty after

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9504
Update xhpast.exe

Summary:
Fixes T4592. I think I got this working. Rough steps were:

  - Install mingw
  - Install git + git bash
  - Using mingw shell //only//, run build script
  - Oh you have to muck with PATH a lot
  - why is it hanging
  - I wish I could paste
  - this looks like a `.exe`

Test Plan: ???

Reviewers: richardvanvelzen

Reviewed By: richardvanvelzen

Subscribers: epriestley

Maniphest Tasks: T4592

Differential Revision: https://secure.phabricator.com/D9378
Update `.gitignore`.

Summary: See inline comments for reasoning.

Test Plan: N/A

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9530
Fix phutil_utf8_console_strlen() for combining characters

Summary:
See D9533. We currently count the length of combining characters incorrectly.

Instead, break the string into glyphs first, then only count the length of the base character in each glyph, ignoring combining characters.

Test Plan: Added some unit tests.

Reviewers: joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

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