Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Releases: hhvm/hhast

Require HHVM 3.24, support call-time-pass-by-reference migration

16 Jan 18:57
71f2ce1
Compare
Choose a tag to compare

This release adds support for - and requires - HHVM 3.24. HHVM 3.23 and below are no longer supported due to changes in the AST.

This release also adds support for migrating code to use call-time-pass-by-reference, which is required in HHVM 3.24.

To do so:

  • checkout the project that needs migrating
  • run hh_client
  • checkout HHAST
  • run bin/hhast-migrate --ctpbr path/to/your/source/

For example:

$ bin/hhast-migrate --ctpbr $HOME/code/fbmarkdown/src/
$ cd $HOME/code/fbmarkdown/src/
$ git diff
diff --git a/src/_Private/decode_html_entity.php b/src/_Private/decode_html_entity.php
index 7891b57..a44b441 100644
--- a/src/_Private/decode_html_entity.php
+++ b/src/_Private/decode_html_entity.php
@@ -25,7 +25,7 @@ function decode_html_entity(string $string): ?(string, string, string) {
     \preg_match(
       '/^&(#[0-9]{1,8}|#X[0-9a-f]{1,8}|[a-z][a-z0-9]*);/i',
       $string,
-      $matches,
+      &$matches,
     ) !== 1
   ) {
     return null;
...

Error suppression, additional linters, performance improvements

08 Jan 22:49
Compare
Choose a tag to compare
  • Added support for ignoring specific errors, or error classes, per file or statement
  • Added linter banning string interpolation
  • Added linter banning whitespace at the end of lines
  • fix position information for trivia
  • performance improvements

Thanks to @bradleyhd and @johanoskarsson

Future release will require HHVM 3.24, due to changes in the AST representation.

Suppressing A Single Lint Error

Add /* HHAST_FIXME[LinterName] */ or /* HHAST_IGNORE_ERROR[LinterName] */' before the relevant statement - for example, to suppress an error raised by DontAwaitInALoopLinter`:

foreach ($in as $item) {
  // TODO: migrate to HH\Lib\Vec\map_async()
  /* HHAST_FIXME[DontAwaitInALoop] */
  $out[] = await $item;'.
}

Suppressing A Linter For A Specific File

As an alternative to putting overrides in the configuration file, /* HHAST_IGNORE_ALL[LinterName] */ can be inserted once.

Support for HHVM 3.23, HSL v1.0, performance improvements

09 Nov 18:41
Compare
Choose a tag to compare
  • Adds compatibility for the upcoming HHVM 3.23 release; this involves both changes to the AST to support new syntax, and internal compatibility with the new shapes syntax
  • Uses v1.0 of the Hack Standard Library
  • Performance improvements - thanks to @bradleyhd

Performance improvements, bugfixes

17 Oct 18:13
Compare
Choose a tag to compare
Pre-release

Thanks to @bradleyhd for most of these fixes

  • significant performance improvements when lint errors are present
  • linter whitelisting now works correctly
  • the case of 'fixed-text' tokens is now preserved (e.g. null vs NULL)
  • error output now includes the linter name; this makes blacklisting easier

Usability improvements

29 Sep 17:39
Compare
Choose a tag to compare
Pre-release
  • parse errors now include the relevant file names.
  • bin/hhast-migrate will no longer attempt to migrate files that don't look like Hack files, unless the specific files - not parent directories - are specified on the command line.
  • bin/hhast-migrate will no longer attempt to migrate files that are in a .git/ directory.
  • bin/hhast-migrate will no longer attempt to migrate files that are in a vendor/ directory by default; this can be overridden with --include-vendor.

bin/hhast-migrate considers a file to be a hack file if either:

  • the first 4 bytes are <?hh.
  • the first 2 bytes are #!, and the first 4 bytes of the second line are <?hh.

If bin/hhast-migrate is not migrating files you are expecting to, run it with --verbose (or -v -v for extra verbosity).

Thanks to @eryi and @simonwelsh for their feedback, which led to these improvements.

Initial release

26 Sep 21:18
Compare
Choose a tag to compare
Initial release Pre-release
Pre-release
v0.1

Don't try to add <<__Override>> to private methods