Documentation
¶
Overview ¶
Command formatcheck measures how far the output of custos format is from the style checkers its presets follow. For each pinned benchmark corpus it copies the corpus's source into a temporary directory, formats a copy with each preset, and runs the preset's reference checker on the unformatted copy (before) and on the formatted one (after):
psr12 PHP_CodeSniffer, standard PSR12 per PHP-CS-Fixer, rule set @PER-CS symfony PHP-CS-Fixer, rule set @Symfony laravel Laravel Pint, preset laravel drupal PHP_CodeSniffer, standard Drupal (drupal/coder)
The reference rules custos deliberately does not satisfy are listed per preset, with a reason, in internal/format/testdata/divergences.json; any other finding after formatting remains, and makes the command exit 1, so `make formatcheck` works as a gate. PHP-CS-Fixer and Pint name every fixer that touched a file, including the fixers that only tidy up after a divergent one (blank lines left by a removed import), and Pint names some whose net change is nil; so for their presets the remaining findings come from a second run with the divergent fixers turned off: its findings for PHP-CS-Fixer, and for Pint the files its fix changes outside docblocks.
The checkers are the benchmark's pinned packages (`go run ./tools/benchcmp install -tool phpcs,php-cs-fixer,pint`), except drupal/coder, which formatcheck installs itself under -tools. The corpora are never modified.