hhvm composer require hhvm/hhast
vendor/bin/hhast-lint src/
This will run a default set of linters against your source tree. If you do not have a configuration file, paths must be specified on the command line.
An hhast-lint.json
in your project root can be used to modify which linters are used, or to otherwise customize the behavior. A minimal configuration would be:
{
"roots": [ "src/" ]
}
This would configure hhast-lint
with no arguments check src/
with otherwise-default settings. For information on additional options, see LinterCLIConfig::TConfigFile
.
Options can also be overriden for specific file patterns or subdirectories - for example, HHAST itself disables autofixes for codegen/
.
Editor and IDE integration requires executing vendor/bin/hhast-lint
when a .hhconfig
and
hhast-lint.json
is present; if you do not trust the repositories you edit code in, this may be a
security risk.
The ide-hhast
package (atom-ide-hhast) shows lint errors, and provides the
option to fix many automatically.
This plugin will prompt before executing vendor/bin/hhast-lint
for each project.
The atom-ide-ui
package is required, unless using Nuclide.
Install vim-hack and ALE; vim-hack
provides filetype detection and syntax highlighting, and ALE
provides support for more advanced features, including HHAST lint error reporting.
To enable HHAST support, add let g:ale_linters = { 'hack': ['hack', 'hhast'] }
to your .vimrc
. Note
that this will execute vendor/bin/hhast-lint
in any project, without further prompting.
Install vscode-hack; this provides a rich experience for Hack and HHAST, including lint error reporting and autofixing.
This plugin will prompt before executing vendor/bin/hhast-lint
for each project.
- atom-ide-hhast for Atom IDE and Nuclide
- vscode-hack for Visual Studio Code