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

1431 commits

Author SHA1 Message Date
Joshua Spence
df1491c449 Alphabetize .arclint linters
Summary: I'm a bit OCD with this, but I find the `.arclint` file easier to read if the keys are in alphabetical order.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9804
2014-07-03 11:56:29 +10:00
Richard van Velzen
792204db95 Refactor author handling in the Mercurial API
Summary: There were two callsites which needed some information from the username. Only one worked "correctly", causing `arc diff` to not amend commits anymore because the author could not be parser.

Test Plan: run `arc diff` with changes

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9797
2014-07-02 13:59:25 -07:00
Joshua Spence
ca5f05e62b Enable unit tests for ArcanistJscsLinterTestCase
Summary:
https://github.com/mdevils/node-jscs/issues/444 has been resolved in commit [[0de667bac2 | 0de667bac2491ba04d930ff94e990965213ba36b]], which means that `jscs` can be easily run on files with any extension.

NOTE: JSCS version 1.5.7 is required.

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9789
2014-07-03 05:15:09 +10:00
Joshua Spence
aaf626fc39 Update spelling data
Summary: Update `ArcanistSpellingDefaultData` with data from the [[http://anonscm.debian.org/gitweb/?p=lintian/lintian.git;a=blob_plain;f=data/spelling/corrections;hb=4b3fc40babff01874b54718406b77b7f3052d26a | original source]].

Test Plan: Visual inspection.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9790
2014-07-01 22:21:49 +10:00
epriestley
0971c728fe Update arcanist NOTICE file
Summary: See D9730.

Test Plan: reading

Reviewers: chad

Reviewed By: chad

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D9731
2014-06-25 13:43:07 -07:00
Joshua Spence
5ab288b30c ArcanistChmodLinter should not allow certain MIME types to be executable
Summary: Fixes T5466. An image is an example of a binary which should //not// be executable. Modify the `ArcanistChmodLinter` to disallow certain blacklisted MIME types from being executable.

Test Plan: Created an executable image file and ran `arc lint` over this file.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: richardvanvelzen, epriestley, Korvin

Maniphest Tasks: T5466

Differential Revision: https://secure.phabricator.com/D9723
2014-06-26 05:30:23 +10:00
Joshua Spence
439dff5e09 Fix a spelling mistake and tidy up whitespace
Summary: Self-explanatory.

Test Plan: Eye-ball it.

Reviewers: epriestley, chad, #blessed_reviewers

Reviewed By: chad, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9705
2014-06-24 15:09:53 +10:00
Joshua Spence
108a4dc9e6 Pass the file contents instead of the file path to phutil_json_decode.
Summary: See D9681#22.

Test Plan: Created an empty `.git/arc/config` file... no exception was thrown.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9704
2014-06-24 12:02:19 +10:00
Joshua Spence
750a94e89f Better handling of .arcconfig files.
Summary:
Throw a useful error message when an `.arcconfig` file is not valid JSON.

Depends on D9697.

Test Plan:
Modified an `.arcconfig` file to be invalid JSON.

```
> arc lint
Usage Exception: Your '~/.arcrc' file is not a valid JSON file.

Parse error on line 18 at column 4: Expected: 'STRING' - It appears you have an extra trailing comma
```

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9681
2014-06-24 09:24:41 +10:00
Joshua Spence
30df78f64c Improve the handling of .arclint files.
Summary: Throw a useful error message when an `.arclint` file is not valid JSON.

Test Plan:
Modified an `.arclint` file to be invalid JSON.

```
> arc lint
Exception
Parse error on line 24 at column 5: Expected one of: 'EOF', '}', ',', ']'
(Run with --trace for a full exception trace.)
```

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9679
2014-06-24 09:24:30 +10:00
Joshua Spence
69cd86fa4f If a PhutilProxyException is thrown by Arcanist, print all error messages.
Summary: `PhutilProxyException` provides the capability to nest exceptions. However, if we throw a `PhutilProxyException` then we currently only display the error message from the top-most exception. Instead, we should print all of the nested exception messages.

Test Plan: Faked an error, saw multiple lines of exception messages.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9697
2014-06-24 09:24:00 +10:00
Joshua Spence
c727a98f73 Add a URL to support a TODO comment.
Summary: Provide a link to a "resolved" [[http://bugs.xdebug.org/view.php?id=1041 | Xdebug issue]] to support a TODO comment. Further information can be found at http://derickrethans.nl/dead-code.html.

Test Plan: Read the article.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9696
2014-06-24 04:56:52 +10:00
Joshua Spence
213628ff34 Skip the "Too Many Errors" error that is raised by JSHint.
Summary: If JSHint encounters //too many// errors (by default, more than 50) errors, then it quits prematurely and raises an additional (rather unhelpful) "Too Many Errors" error. We should just ignore this additional error.

Test Plan: Added a test case.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9693
2014-06-24 04:16:15 +10:00
Joshua Spence
48d62ed444 Don't use error context from JSHint in linter messages
Summary:
The error context (a.k.a. "original text") as provided by `jshint` is not very useful and actually causes `arc lint` to display the lint message incorrectly.

{F169277}

The underlying problem here is that the error context from `jshint` contains the entire line from the input file rather than just the offending source code.

Test Plan: Ran `arc lint -- webroot/rsrc/js/core/behavior-hovercard.js` (in rP) and verified that the output looked reasonable.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9675
2014-06-23 10:33:01 +10:00
Joshua Spence
4fd6c99a93 Only lint files in the working copy with arc lint --everything.
Summary: Fixes T5442. `arc lint --everything` currently uses a `FileFinder` to discover paths for linting. A consequence of this is that files that are ignored or otherwise excluded from version control are linted.

Test Plan: Ran `arc lint --everything` in rPHU and noticed that I wasn't prompted to add a trailing newline to `src/.phutil_module_cache`.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5442

Differential Revision: https://secure.phabricator.com/D9674
2014-06-23 10:30:57 +10:00
epriestley
b2aeca1963 Remove SBTLinter from ComprehensiveEngine
Summary: D9664 removed this, clean up this remaining callsite.

Test Plan: `grep`

Reviewers: chad, joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D9668
2014-06-22 12:40:36 -07:00
Joshua Spence
2f3e5e48ef Read extension classes and functions from php_compat_info.json.
Summary: Consolidate `php_extension_classes.txt` and `php_extension_functions.txt` with `php_compat_info.json`. Given that `php_extension_classes.txt` and `php_extension_functions.txt` are manually generated whereas `php_compat_info.json` is generated automatically, this should make maintenance easier.

Test Plan: Deleted the `src/.phutil_module_cache` file (in each of rARC, rPHU and rP) and ran `arc liberate`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9662
2014-06-23 04:26:01 +10:00
Joshua Spence
3228f7789c Remove the ArcanistScalaSBTLinter
Summary: As discussed in D9097, the `ArcanistScalaSBTLinter` isn't //really// a linter. Eventually we should add support for a proper Scala linter, but I think that supporting the `ArcanistScalaSBTLinter` as-is is more effort than it is worth.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9664
2014-06-23 04:12:26 +10:00
Joshua Spence
60d879fc8c Add unit tests for ArcanistPylintLinter.
Summary: Self-explanatory.

Test Plan: Ran the tests.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9661
2014-06-23 03:32:35 +10:00
Joshua Spence
4f96a23485 Minor fix for the ArcanistXHPASTLinter.
Summary: This `LINT_PHP_53_FEATURES` should have been replaced with `LINT_PHP_COMPATIBILITY` in D9576.

Test Plan: Ran `arc unit`.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9655
2014-06-23 01:56:57 +10:00
Joshua Spence
990027e3e0 Improve the handling of the php_compat_info.json file.
Summary: See inline comments on D9576. Also replace `json_decode` with `phutil_json_decode`, for better error handling.

Test Plan: Make sure `arc unit` still works.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9656
2014-06-23 01:56:44 +10:00
Joshua Spence
b9b9c138fe Lint JSON files with ArcanistJSONLinter.
Summary: After D9628, we can lint JSON files natively.

Test Plan: Linted a few JSON files manually (i.e. `arc lint --trace -- $FILE`).

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9652
2014-06-23 01:55:48 +10:00
Joshua Spence
cf998db5e0 Add a native JSON linter.
Summary:
Ref T5297. Utilize `PhutilJSONParser` to create a native JSON linter (native in that it is pure PHP with no external dependencies).

Since [[https://github.com/Seldaek/jsonlint | JsonLint]] is literally a PHP port of [[https://github.com/zaach/jsonlint | jsonlint]], I figured that we should also deprecate `ArcanistJSONLintLinter`. `ArcanistJSONLinter` //should// behave identically to `ArcanistJSONLintLinter`.

Depends on D9634.

Test Plan: Ran the `ArcanistJSONLintLinter` unit tests.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5297

Differential Revision: https://secure.phabricator.com/D9628
2014-06-22 06:41:22 +10:00
Joshua Spence
a428f22cbf Don't throw an exception if no configuration is set for linter tests
Summary: This was broken in D9641. If `$config` is not set, then a `PhutilJSONParserException` will be thrown. The expected behaviour is that it is okay to not explicitly set any configuration.

Test Plan: Ran `arc unit`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9643
2014-06-21 07:15:38 +10:00
Joshua Spence
5ee12bbad6 Update callsites of phutil_json_decode.
Summary: Depends on D9634. `phutil_json_decode` now throws an exception on invalid JSON.

Test Plan: Ran the unit tests.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9641
2014-06-21 00:39:20 +10:00
Joshua Spence
67b6bed92e Tidying up of linter code.
Summary: Various tidying up of linting code.

Test Plan: `arc lint` and `arc unit` still pass.

Reviewers: chad, epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9625
2014-06-20 18:26:44 +10:00
Joshua Spence
212c41fbd0 Add unit tests for ArcanistMergeConflictLinter.
Summary: Self explanatory. Also fixed the character offset to start at 1 instead of 0 (because the other linters seem to do this).

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9626
2014-06-20 07:59:12 +10:00
epriestley
2198cc2849 Fix an issue with arc branch and very old branches
Summary:
In D9595, we stopped parsing short-form "Differential Revision:" fields in commit messages, and only accept URLs.

I have one of the older style commit messages in my local `arcanist/`, so now we go down this parse failure branch in `arc branch`. This has never worked quite correctly, and if the parse fails we end up with a bad branch dictionary that is missing fields.

Test Plan: Ran `arc branch` in a working copy with an old `Differential Revision:` field at the head of a branch. Before patch: explosions; after patch: works great.

Reviewers: joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D9620
2014-06-18 08:35:29 -07:00
epriestley
dd1f93d77b Fix race condition inside git diff-files
Summary:
There's some sort of race inside `git` here, where the `git diff-files` command exits with different results some of the time when run in parallel with `git ls-files` or `git diff` (running either command was sufficient to trigger the race).

Run it separately to avoid the race.

I poked around the `git` source a little bit but quickly lost interest given that the issue seems fixed and this workaround is essentially reasonable.

Test Plan: Ran test 20x in a row without failures.

Reviewers: hach-que

Reviewed By: hach-que

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D9616
2014-06-18 05:33:05 -07:00
Joshua Spence
9257f1bc85 Add a newline to the output of arc help --full.
Summary: The output from `arc help --full` is missing a newline character.

Test Plan:
**Before**
```
> arc help --full
      --skip-arcconfig
           Skip the working copy configuration file

      --arcrc-file filename
           Use provided file instead of ~/.arcrc.>
```

**After**
```
> arc help --full
      --skip-arcconfig
           Skip the working copy configuration file

      --arcrc-file filename
           Use provided file instead of ~/.arcrc.
>
```

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9608
2014-06-18 08:07:02 +10:00
Richard van Velzen
680ec3670c Don't parse mercurial usernames without email address as an email address
Summary:
This leads to information being lost when others do `arc patch` because the name is used as the email address.

For example:
  username = Richard van Velzen

Would give:
  'authorName' => null,
  'authorEmail' => 'Richard van Velzen'

Test Plan:
ran it through my head a couple of times, and tested it with the common options which all gave the expected result:
  'rvanvelzen@company.com',
  'Richard van Velzen',
  'Richard van Velzen <rvanvelzen@company.com>',
  'Richard van Velzen rvanvelzen@company.com',

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9605
2014-06-17 11:46:49 -07:00
Joshua Spence
d7541c70dd Convert arc list to use PhutilConsoleTable.
Summary: Similar to D9601 and D9602. Also added pretty colors.

Test Plan: {F167702}

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9603
2014-06-18 03:42:53 +10:00
Joshua Spence
7a99e4bc93 Convert arc feature to use PhutilConsoleTable.
Summary: Fixes T5110. `PhutilConsoleTable` handles Unicode characters and can display a decent-looking table.

Test Plan: {F167698}

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5110

Differential Revision: https://secure.phabricator.com/D9602
2014-06-18 03:41:21 +10:00
Joshua Spence
9f8a23d598 Convert arc tasks to use PhutilConsoleTable.
Summary: `PhutilConsoleTable` does a better job at aligning columns. We still probably need to do some work to `PhutilConsoleTable` to set a maximum width for a specified column, or elect which columns can be truncated etc but this can probably come later.

Test Plan: {F167687}

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9601
2014-06-18 03:01:39 +10:00
Joshua Spence
46e0553c46 Modernize .arclint file.
Summary:
Update the `.arclint` file after D9576 and D9590.

Depends on D9576, D9590.

Test Plan: Eyeball it.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9591
2014-06-18 02:41:28 +10:00
Joshua Spence
f2f5fb2508 Drop support for parsing non-URL differential IDs from commit message.
Summary: This has been a `TODO` for a few years now... no-one should be using the old-school (non-URL) syntax anymore.

Test Plan: I'm actually not sure if it's okay to drop support for this... please verify.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9595
2014-06-18 01:39:28 +10:00
Joshua Spence
4c99a65567 Allow PHP version to be customized with ArcanistXHPASTLinter
Summary: Fixes T5385. Provide a flexible means of setting a minimum PHP version for the `ArcanistXHPASTLinter`, instead of relying on `ArcanistXHPASTLinter::LINT_PHP_53_FEATURES` and `ArcanistXHPASTLinter::LINT_PHP_54_FEATURES`.

Test Plan: Fixed up and ran unit tests.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5385

Differential Revision: https://secure.phabricator.com/D9576
2014-06-18 01:30:15 +10:00
Joshua Spence
473c6d89d7 Move the "ragged classtree edge" linter rule to ArcanistPhutilXHPASTLinter.
Summary: This linter rule is very specific to the Phabricator and it is unlikely that it is being used elsewhere. We should move it to `ArcanistPhutilXHPASTLinter`, where other Phabricator-specific linting code lives.

Test Plan: Moved the corresponding test case.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9590
2014-06-18 01:28:40 +10:00
Richard van Velzen
3810cdbbcc Let arc liberate throw on unsupported PHP features
Summary: Ref T4725.

Test Plan: add some files that have unsupported constructs all over the place and run `arc liberate`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T4725

Differential Revision: https://secure.phabricator.com/D9585
2014-06-17 05:13:05 -07:00
Richard van Velzen
3201239e85 Correctly recognize "no bookmarks" for Mercurial
Summary: Fixes T5086.

Test Plan: remove all bookmarks and run `arc feature`

Reviewers: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5086

Differential Revision: https://secure.phabricator.com/D9588
2014-06-17 04:51:55 -07:00
Richard van Velzen
8d7ee9ee38 Let phutil_rebuild_map **really** be quiet
Summary: Depends on D9586. The progress bar is written to stderr which results in bad stuff happening when you try run `lint` (`PhutilLibraryLinter` calls it)

Test Plan: run `arc lint`, see no more errors

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9587
2014-06-16 15:49:08 -07:00
Tal Shiri
5a02012706 Allow specifying runtime configuration with --set-config key=value
Summary:
This is useful for wrapper scripts that want to customize arcanist's behavior without affecting the global configuration.
This can be implemented with arcanist_configuration entry in .arcconfig, however it is currently limited to
per-project settings, and this feature makes writing wrapper scripts a little easier.

Test Plan: arc diff --set-config editor=vim (yeah yeah, crappy test case)

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9442
2014-06-16 15:28:33 -07:00
Richard van Velzen
2ccf65353c Let phutil_rebuild_map show a progress bar
Summary: .. Instead of dots that are hard to count.

Test Plan: remove `.phutil_module_cache` and do `arc liberate`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9584
2014-06-16 15:27:59 -07:00
Joshua Spence
b1ddd0f03b Add an ArcanistJscsLinter.
Summary: Add a linter which wraps around [[https://github.com/mdevils/node-jscs | JSCS]].

Test Plan: Currently, we can't test this linter with out existing infrastructure. Specifically, `jscs` will only lint `*.js` files. I have done a fair bit of manual testing though.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9565
2014-06-17 06:40:36 +10:00
Joshua Spence
419a1247c2 Remove the deprecated ArcanistWorkCopyIdentity::getConfig method.
Summary: This method has been deprecated for a while now (see rARC0d212ccf5a7ac5fc75d2d3036cb3a0bee220fd02). It should be safe to remove.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9466
2014-06-17 06:39:47 +10:00
Ben Alpert
ee3baade6e Add --no-verify to git commit call for arc patch
Summary: I can't find an analogous flag for hg.

Test Plan: I don't have any precommit hooks set up on my machine so I can't test this easily, but I think this seems pretty harmless?

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9523
2014-06-16 11:39:58 -07:00
Joshua Spence
36698b92af Add constants and class methods to php_compat_info.json.
Summary: Allows the `ArcanistXHPASTLinter` to determine whether constants can be used, based on the target PHP version. Also added class methods to the compatibility information, although this isn't used yet (it is small anyway).

Test Plan: Created a test file that contained the `JSON_PRETTY_PRINT` constant. Verified that a linter error was raised.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9571
2014-06-17 01:00:23 +10:00
Joshua Spence
8f8ab969db Update update_compat_info.php to use PHP_CompatInfo version 3
Summary:
Fixes T5377. The current `scripts/update_compat_info.php` script works for PHP CompatInfo version 2, but doesn't work with the newer version 3.

There are a few breaking changes in version 3 that had to be addressed:

- PHP 5.3 is required. Whilst Arcanist is generally compatible with PHP 5.2, I don't think that having this dependency presents any real issues because it is purely a development tool that is rarely updated.
- [[https://getcomposer.org/ | Composer]] is used for packaging, which makes including the library slightly more complicated. Basically, I had to install `PHP_CompatInfo` globally with Composer (`composer global require "bartlett/php-compatinfo"` and then symlink `~/.composer/vendor` into `externals/includes`.

Test Plan: Compared the `resources/php_compat_info.json` file. There are a bunch of functions/classes that //were// in this file but are no longer, but I think that I've covered the most popular extensions.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5377

Differential Revision: https://secure.phabricator.com/D9568
2014-06-17 00:30:16 +10:00
Joshua Spence
497229acd8 Made some additional methods final.
Summary: Just some minor tidying up. I don't think that these methods should ever be overridden in subclasses.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9569
2014-06-17 00:30:04 +10:00
Joshua Spence
523d767646 Add a unit test to check src/__phutil_library_map__.php.
Summary: See D9557. Add a unit test to ensure that `src/__phutil_library_map__.php` is up-to-date.

Test Plan: Ran `arc unit`.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9558
2014-06-16 05:42:43 +10:00