PHPackages                             hhvm/hhast - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hhvm/hhast

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

hhvm/hhast
==========

A mutable AST library for Hack with linting and code migrations

v4.168.3(2y ago)741.0M↓50%43[36 issues](https://github.com/hhvm/hhast/issues)[4 PRs](https://github.com/hhvm/hhast/pulls)20MITHack

Since Sep 26Pushed 2y ago21 watchersCompare

[ Source](https://github.com/hhvm/hhast)[ Packagist](https://packagist.org/packages/hhvm/hhast)[ RSS](/packages/hhvm-hhast/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (177)Used By (20)

HHAST
=====

[](#hhast)

[![Continuous Integration](https://github.com/hhvm/hhast/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/hhvm/hhast/actions/workflows/build-and-test.yml)

HHAST is a toolkit for processing the AST of Hack files.

Abstract syntax trees can be an extremely powerful basis for many kinds of tooling beyond compilers and optimization; HHAST is built on top of Hack's Full Fidelity Parser (FFP), providing a Hack object representation of a *mutable* AST.

Unlike traditional ASTs, the FFP's AST includes all 'trivia' - such as whitespace and comments - allowing you to fully recreate the file from the AST, or create an updated file after mutating the AST, preserving comments and whitespace.

HHAST has 3 main APIs:

- a low-level library for inspecting and manipulating the FFP AST
- a linting framework, with support for auto-fixing linters
- a migration framework

Linters
-------

[](#linters)

- [user documentation](docs/linters-usage.md)
- [developer documentation](docs/linters-development.md)

[![screenshot of lint errors](docs/linters.png)](docs/linters.png)

Linters are designed for subjective or style changes which do not substantially alter the behavior of the code, and may be rejected on a case-by-case basis. Lint errors can provide a suggested fix, which may be based on an AST mutation, but doesn't have to be.

We've included several linters as a starting point, including:

- don't use await in a loop
- methods should be -&gt;lowerCamelCase(), functions should be under\_scored()
- always use braces for control flow
- always use [``](https://docs.hhvm.com/hack/attributes/special#__override) where possible

Linters can be used both interactively, or unattended. Autofixing is not supported unattended, however it will exit with non-zero if there are any lint issues, to ease integration with CI systems.

### Editor and IDE Support

[](#editor-and-ide-support)

[![screenshot of lint errors in VSCode](docs/linters-vscode.png)](docs/linters-vscode.png)

HHAST is supported by:

- [ALE](https://github.com/w0rp/ale/) for Vim 8 and neovim
- [atom-ide-hhast](https://github.com/hhvm/atom-ide-hhast/) for Atom IDE and Nuclide
- [vscode-hack](https://marketplace.visualstudio.com/items?itemName=pranayagarwal.vscode-hack) for Visual Studio Code

Migrations
----------

[](#migrations)

- [user documentation](docs/migrations-usage.md)
- most of the [linters developer documentation](docs/linters-development.md)applies for migrations too

[![screenshot of a migration](docs/migrations.png)](docs/migrations.png)

Migrations are for sweeping changes you want to apply across your entire codebase, and are often more complex. Taking this into account, the migration framework has built-in support for multi-step migrations (unlike linters). AST-aware migrations can be a powerful tool for:

- adjusting for changes to the language (for example, the shape changes described below)
- replacing deprecated APIs with new ones
- general clean-up of the codebase

Low-level AST library
---------------------

[](#low-level-ast-library)

See [the documentation](docs/ast-lib.md).

License
-------

[](#license)

HHAST is MIT-licensed.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community47

Growing community involvement

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 71.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~12 days

Recently: every ~107 days

Total

176

Last Release

930d ago

Major Versions

v0.6 → v1.02018-02-09

v1.0.1 → v3.26.02018-05-10

v3.30.0 → v4.0.02019-02-08

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8306375?v=4)[HHVM Community Bot](/maintainers/hhvm-bot)[@hhvm-bot](https://github.com/hhvm-bot)

![](https://avatars.githubusercontent.com/u/601530?v=4)[Yang, Bo](/maintainers/Atry)[@Atry](https://github.com/Atry)

![](https://avatars.githubusercontent.com/u/727402?v=4)[Alexey Toptygin](/maintainers/alexeyt)[@alexeyt](https://github.com/alexeyt)

---

Top Contributors

[![fredemmott](https://avatars.githubusercontent.com/u/360927?v=4)](https://github.com/fredemmott "fredemmott (849 commits)")[![jjergus](https://avatars.githubusercontent.com/u/2483917?v=4)](https://github.com/jjergus "jjergus (97 commits)")[![Atry](https://avatars.githubusercontent.com/u/601530?v=4)](https://github.com/Atry "Atry (93 commits)")[![lexidor](https://avatars.githubusercontent.com/u/31805625?v=4)](https://github.com/lexidor "lexidor (54 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (23 commits)")[![ryangreenberg](https://avatars.githubusercontent.com/u/134712?v=4)](https://github.com/ryangreenberg "ryangreenberg (13 commits)")[![bradleyhd](https://avatars.githubusercontent.com/u/4551889?v=4)](https://github.com/bradleyhd "bradleyhd (9 commits)")[![wlin53](https://avatars.githubusercontent.com/u/26862692?v=4)](https://github.com/wlin53 "wlin53 (9 commits)")[![aloiret](https://avatars.githubusercontent.com/u/1227963?v=4)](https://github.com/aloiret "aloiret (5 commits)")[![azjezz](https://avatars.githubusercontent.com/u/29315886?v=4)](https://github.com/azjezz "azjezz (4 commits)")[![alexeyt](https://avatars.githubusercontent.com/u/727402?v=4)](https://github.com/alexeyt "alexeyt (3 commits)")[![aloiret-ed](https://avatars.githubusercontent.com/u/92757732?v=4)](https://github.com/aloiret-ed "aloiret-ed (3 commits)")[![johanoskarsson](https://avatars.githubusercontent.com/u/26380?v=4)](https://github.com/johanoskarsson "johanoskarsson (3 commits)")[![nrockenbach](https://avatars.githubusercontent.com/u/105754017?v=4)](https://github.com/nrockenbach "nrockenbach (2 commits)")[![muglug](https://avatars.githubusercontent.com/u/2292638?v=4)](https://github.com/muglug "muglug (2 commits)")[![ssandler](https://avatars.githubusercontent.com/u/1163725?v=4)](https://github.com/ssandler "ssandler (2 commits)")[![Matt-Schellhas](https://avatars.githubusercontent.com/u/45602524?v=4)](https://github.com/Matt-Schellhas "Matt-Schellhas (1 commits)")[![nathro](https://avatars.githubusercontent.com/u/1355959?v=4)](https://github.com/nathro "nathro (1 commits)")[![PranayAgarwal](https://avatars.githubusercontent.com/u/341507?v=4)](https://github.com/PranayAgarwal "PranayAgarwal (1 commits)")[![jchaffraix-slack](https://avatars.githubusercontent.com/u/56851540?v=4)](https://github.com/jchaffraix-slack "jchaffraix-slack (1 commits)")

---

Tags

hacklanghhvm

### Embed Badge

![Health badge](/badges/hhvm-hhast/health.svg)

```
[![Health](https://phpackages.com/badges/hhvm-hhast/health.svg)](https://phpackages.com/packages/hhvm-hhast)
```

###  Alternatives

[hhvm/hsl

The Hack Standard Library

1151.1M55](/packages/hhvm-hsl)[slack/hack-json-schema

Hack JSON Schema generator

302.4k](/packages/slack-hack-json-schema)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
