Skip to content

Make configurable fixers honor their ECS config options - #100

Merged
TomasVotruba merged 2 commits into
mainfrom
blink-configurable-fixers
Sep 30, 2026
Merged

TomasVotruba merged 2 commits into
mainfrom
blink-configurable-fixers

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Follow-up to the configurability work (stacks on #98). Wires per-fixer PHP-CS-Fixer options through the turbo/--blink path so blink honors the dumped ECS config instead of ignoring it.

What lands

42 fixers become configurable via the ConfigurableFixer interface (the turbo resolver already dispatches to it): array/list/comma/offset, operators and spacing, casing/language/control-simple, class/function/imports, and whitespace/control-structure fixers. Each reads its options from the dumped ECS config, implements the full option set, and has unit tests. Examples: ArraySyntax/ListSyntax (syntax), ConcatSpace/CastSpaces/DeclareEqualNormalize/SpacesInsideParentheses (space/spacing), NoExtraBlankLines (tokens, incl. throw/use), YodaStyle (equal/identical/less_and_greater), OrderedImports (sort_algorithm/imports_order), VisibilityRequired/SingleClassElementPerStatement (elements), ReturnTypeDeclaration (space_before), and more.

Turbo rules are now applied in the same canonical priority order as the standalone path (rules.CanonicalOrder), matching ECS's execution order.

Design (no regression)

Zero-value structs keep today's behavior byte-for-byte; WithConfig only overrides when the ECS config supplies an option. Verified:

  • standalone parity vs ECS on rector-src: 0/1699
  • --blink parity on this repo: 1 (unchanged from baseline)
  • go build, go vet, gofmt -s, go test ./... all pass

Deferred: PHPDoc fixers

The 9 PHPDoc fixers are intentionally left at their current tuned behavior. Honoring their options in blink's single pass diverges from ECS's iterate-to-fixpoint PHPDoc handling (measured: enabling them regressed --blink parity on this repo from 1 to 45, all from the PHPDoc group). They need per-fixer work to reproduce ECS's multi-pass result and will follow separately.

Wire per-fixer PHP-CS-Fixer options through the turbo/--blink path via the
ConfigurableFixer interface: array, operator, spacing, casing, language,
class, function, import, whitespace and control-structure fixers now read their
options from the dumped ECS config, with full option semantics and unit tests.
Zero-value structs keep today's behavior, so standalone parity stays 0/1699 and
--blink parity is unchanged.

PHPDoc fixers are deferred: honoring their options in a single pass diverges from
ECS's iterate-to-fixpoint phpdoc handling, so they keep their tuned behavior.
@TomasVotruba
TomasVotruba force-pushed the blink-configurable-fixers branch from 4e6b430 to b3b3427 Compare September 30, 2026 05:43
@TomasVotruba
TomasVotruba enabled auto-merge (squash) September 30, 2026 05:43
@TomasVotruba
TomasVotruba merged commit 06c93ff into main Sep 30, 2026
16 of 17 checks passed
@TomasVotruba
TomasVotruba deleted the blink-configurable-fixers branch September 30, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant