Download the PHP package hershel-theodore-layton/portable-hack-ast-linters-server without Composer
On this page you can find all versions of the php package hershel-theodore-layton/portable-hack-ast-linters-server. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hershel-theodore-layton/portable-hack-ast-linters-server
More information about hershel-theodore-layton/portable-hack-ast-linters-server
Files in hershel-theodore-layton/portable-hack-ast-linters-server
Package portable-hack-ast-linters-server
Short Description A non-Hack distribution of PhaLinters to allow HTL packages to use portable-hack-ast-linters without circular dependencies.
License MIT
Informations about the package portable-hack-ast-linters-server
portable-hack-ast-linters-server
A non-Hack distribution of PhaLinters to allow HTL packages to use portable-hack-ast-linters without circular dependencies.
How to use
- Optionally install the VSCode extension[^1] and configure it in
.vscode/settings.json
.http://localhost:10641?format=json&action=lint-input
is a good default.
- Launch the server using the CLI instructions below.
- Make sure to configure the port is exposed to the host network in Docker.
- Lint the entire project using
curl http://localhost:10641
.- The following query parameters are supported:
format=text/vscode-json
text
(default) output human readable text.vscode-json
output json for use with the extension.
directories=src,tests
- A comma separated list of directory names relative to the project root.
- Only effective when
action
islint-all
action=lint-all/lint-input
lint-all
(default) scan alldirectories
for lint errorslint-input
lint the Hack source text sent in the request body.
- Lint files interactively by opening them in VSCode with the extension installed.
CLI
This distribution of PhaLinters
can be spawned using the vendor/bin/pha-linters-server.sh
script.
In the examples below $SERVER_SH
should expand to the script path above.
When running interactively, you may see the following prompt:
When you type I trust this resource
, you understand the risks involved with
compiling and running this resource.
Dependency hacking
This package depends on portable-hack-ast(-linters|-extras)
at build time,
but the bundled output does not. This bundling process allows portable-hack-ast
and portable-hack-ast-extras
to use this package without circular dependencies.
This is accomplished by publishing an empty composer.json
file.
When developing this bundle, you must select the composer file with dependencies.
Set the COMPOSER
environment
variable to composer.dev.json
.
This will install the dependencies, whereas composer update
without the
environment variable set will not install anything.
Developing
Since the bundle can't depend on any unbundled code, for example hhvm-autoload
,
developing this package requires the ini settinghhvm.autoload.enabled=true
.
Downstream consumers don't need native autoloading, since the bundle includes
all the dependencies in a single file.
When you are testing live (not the bundle itself), you can start the server using:
If you want to test the bundle, use the following command:
This will rebuild, recompile and start the lint-server.
[^1]:
This extension is available on open-vsx.org at the time of writing.
Stock VSCode is configured to load extensions from the VSCode Marketplace.
If you are using VSCode, download and install the .vsix
file.
If you are using a VSCode fork, such as VSCodium, you can find the
extension in the extension search tab, since VSCode forks use open-vsx.