/** * Auto-format generated PHP files via Laravel Pint. Issue #100 v5.8.20. * * Reporter scenario (godx-jp/godx-kintai 2026-04-26 audit): every * `omnify generate --force` produces 150+ PHP files that fail Laravel * Pint's standard preset (`vendor/bin/pint --test`): * * - ordered_imports — `use` statements not alphabetised * - fully_qualified_strict_types — exception types referenced via FQN * - class_attributes_separation — missing blank lines between members * - function_declaration — function-keyword spacing * - unary_operator_spaces — `! \$x` vs `!\$x` * - no_unused_imports — codegen leaves the occasional dangling import * - single_line_empty_body — empty class bodies on multiple lines * - self_static_accessor — `self::` vs `static::` on enums * - blank_line_before_statement — enum `case` separators * * Auto-detect: when `/vendor/bin/pint` exists, run it on the * files we just wrote. Same Pint preset the project's CI already uses, * so no risk of formatter drift between codegen and CI checks. * * Opt-out: future config field; for now `chmod -x vendor/bin/pint` or * deleting it disables the auto-run. */ /** * Resolve the `vendor/bin/pint` path for the project. Walks up from * the first written file until we find a sibling `vendor/bin/pint`, * stopping at filesystem root or after 12 levels (defensive against * pathological inputs). Returns the absolute path or null. */ export declare function findPintBinary(anyWrittenPhpPath: string): string | null; export interface PintFormatResult { ran: boolean; pintPath: string | null; /** Files passed to pint. */ formattedCount: number; /** Pint's exit status if it ran. 0 = success. */ exitStatus: number | null; /** Captured stderr when pint failed (status != 0). */ errorMessage?: string; /** * Why the run did not happen, when `ran` is false. The caller needs the three apart: only * `pint-not-found` is worth telling a human about, and it is the one that silently changes what * gets written to disk (godx-jp/godx-corebooks#108 — 927 files, reproduced). */ skipped?: 'no-php-files' | 'opted-out' | 'pint-not-found'; } /** * Run Laravel Pint on the given PHP files (absolute paths). No-op if * Pint isn't installed in the project. Pint is invoked with `--quiet` * so it stays out of the way unless something breaks. * * Pint takes a list of files (or directories) and formats them in * place. It uses the project's `pint.json` config if present, else the * Laravel preset. */ export declare function runPintFormat(writtenPhpPaths: string[]): PintFormatResult;