formatcheck

command
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL