Skip to content

Add LineLength fixer to blink - #212

Merged
TomasVotruba merged 1 commit into
mainfrom
blink-line-length-fixer
Oct 20, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
blink-line-length-fixer

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Ports Symplify LineLengthFixer to blink, so --blink runs no longer skip it as unsupported.

Behavior

  • Breaks array items, method/function call arguments, new arguments, attribute arguments, closure use (...) and function parameters onto standalone lines when the opening line exceeds the limit (default 120).
  • Inlines a short multiline block back onto a single line when the whole thing fits.
  • Skips keyed (=>) arrays, heredocs/nowdocs, commented blocks, empty blocks and promoted-property constructors, matching the PHP fixer.
  • Faithful ports of the length resolvers, indent detection and ensureWhitespaceAtIndex semantics so output matches ECS byte for byte.
  • Configurable via line_length, break_long_lines, inline_short_lines.

Tests

TestLineLength reproduces every LineLengthFixerTest fixture (before → after, and unchanged for the correct*/skip* cases).

README rule counts updated (blink 210 → 211).

Port Symplify LineLengthFixer: break array items, call/new/attribute
arguments and function parameters onto standalone lines when the opening
line exceeds the limit, and inline a short multiline block back onto one
line. Skips keyed arrays, heredocs, commented and promoted-property
blocks, matching the PHP fixer.

Reproduce every LineLengthFixerTest fixture as a Go test.
@TomasVotruba
TomasVotruba merged commit b9f829e into main Oct 20, 2026
19 of 20 checks passed
@TomasVotruba
TomasVotruba deleted the blink-line-length-fixer branch October 20, 2026 21:00
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