--blink hands the run over to the ecs-go Go binary instead of the PHP engine:
vendor/bin/ecs check --blink # report only (like a normal check)
vendor/bin/ecs check --blink --fix # rewrite files in place
vendor/bin/ecs check src --blink # limit to a path - pass the path before the flagPass any explicit path before the flags (check src --blink), as with --fix; a path written after a boolean flag is consumed as that flag's value.
ECS resolves the configuration from ecs.php (paths, rules and skips) exactly as usual, dumps it to a temporary JSON file, and hands that file to ecs-go via --ecs-config. ecs-go maps each ECS rule onto its own fixer by class name, applies the shared paths and skips, and reports every rule it could not map. The check/fix split maps onto ecs-go directly:
--blinkrunsecs-go --ecs-config <config.json>- reports without writing.--blink --fixrunsecs-go --ecs-config <config.json> --fix- rewrites in place.
The exit code of ecs-go is passed through.
The JSON ecs-go consumes can also be inspected on its own:
vendor/bin/ecs dump-config # print the resolved paths, rules and skips as JSONThe shape is:
{
"paths": ["/abs/src"],
"rules": [
{ "class": "PhpCsFixer\\Fixer\\ArrayNotation\\ArraySyntaxFixer", "config": { "syntax": "short" } },
{ "class": "PhpCsFixer\\Fixer\\CastNotation\\LowercaseCastFixer", "config": {} }
],
"skips": [
{ "path": "*/Legacy/*" },
{ "class": "PhpCsFixer\\Fixer\\Import\\OrderedImportsFixer" },
{ "class": "PhpCsFixer\\Fixer\\CastNotation\\LowercaseCastFixer", "paths": ["*/tests/*"] }
]
}Configured fixer options are read off the fixer instance; sniff properties are not extracted yet.
The ecs-go binary is looked up in this order:
- the
ECS_BLINK_BINenvironment variable, if it points to an existing file; - the binary bundled with ECS in
bin/asblink-<platform>(Linux, macOS and Windows, amd64 and arm64); vendor/bin/ecs-go, if present;ecs-goon thePATH.
If none is found, --blink fails with an error explaining how to provide the binary.
This is an RFC-stage prototype. ecs-go reads the rules and skips from your ecs.php (not just the paths), and because every ecs-go fixer is named by its PHP-CS-Fixer class, the rules map straight across by name. Every rule ecs-go has no fixer for is reported and skipped, and a configured rule runs with ecs-go's built-in behaviour (its configuration is not modelled yet) and is noted in the report. So a blink run is never silently narrower than your config, but it is not yet equivalent to a full ECS run.
The release build cross-compiles ecs-go from its main branch and ships it in bin/ as blink-<platform>, so --blink works out of the box on Linux, macOS and Windows - no Go toolchain needed.