Releases: hhvm/hhast
Require HHVM 3.24, support call-time-pass-by-reference migration
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
- 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
- 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
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
vsNULL
) - error output now includes the linter name; this makes blacklisting easier
Usability improvements
- 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 avendor/
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
v0.1 Don't try to add <<__Override>> to private methods