hhpack / typechecker-client
Type checker client library for Hack
Installs: 177
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Language:Hack
Requires
- hhvm: >=3.11.0
- hhpack/process: ^1.0
Requires (Dev)
README
Basic usage
Examples of the type of check will be as follows.
use HHPack\TypeChecker\TypeCheckerClient; $client = new TypeCheckerClient(getcwd()); await $client->restart(); $result = await $client->check(); if ($result->isPassed()) { echo "Passed!!", PHP_EOL; } else { echo "Failed!!", PHP_EOL; }
Type of coverage
Examples of the type of coverage will be as follows.
use HHPack\TypeChecker\TypeCheckerClient; use HHPack\TypeChecker\Coverage\File; $client = new TypeCheckerClient(getcwd()); await $client->restart(); $result = await $client->coverage(); $files = $result->filter(($item) ==> { return $item instanceof File; }); foreach ($files as $file) { $formattedParsentage = sprintf('%6.2f%%', (float) $file->parsentage() * 100); echo $formattedParsentage, ' ', $file->name(), PHP_EOL; }
API of Client
- version - return type checker version
- init - generate configuration file
- start - starts a hack server
- stop - stops a hack server
- restart - restarts a hack server
- check - return result of type check
- coverage - return result of coverage
Run the test
You can run the test with the following command.
composer install
composer test