Skip to content

Port new formatter#4552

Open
doriable wants to merge 7 commits into
mainfrom
worktree-port-formatter
Open

Port new formatter#4552
doriable wants to merge 7 commits into
mainfrom
worktree-port-formatter

Conversation

@doriable
Copy link
Copy Markdown
Member

@doriable doriable commented May 22, 2026

This PR replaces the legacy formatter with the new formatter,
based on the new compiler's AST printer.

All of the goldens that have changed have been tested for how
they would affect users/if they would create churn

  • the new formatter adds a space for contiguous in-line block comments (should be a very rare case)
  • the newline between declarations being source-aware will not produce any churn for any files that users have already formatted with the legacy formatter
  • and the behaviour for detached comments is actually fixed between declarations

This also uses mutations to the new AST to implement the deprecation feature
in the formatter.

@doriable doriable requested a review from emcfarlane May 22, 2026 21:46
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 2026

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 22, 2026, 10:34 PM

@doriable doriable marked this pull request as ready for review May 22, 2026 22:34
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