Skip to content

feat(format): add expanded VALUES row layout - #850

Merged
psteinroe merged 1 commit into
supabase-community:mainfrom
edjubert:edjubert/values-row-layout
Oct 15, 2026
Merged

psteinroe merged 1 commit into
supabase-community:mainfrom
edjubert:edjubert/values-row-layout

Conversation

@edjubert

@edjubert edjubert commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Formatter feature and bug fix, with configuration, generated bindings, and documentation updates.

What is the current behavior?

VALUES rows stay on one line when they fit within lineWidth. There is no option to put every tuple on its own indented line. Separators between tuples always use trailing commas, even with commaStyle: "leading".

Related: #816 introduced leading commas for fill lists; this change applies that behavior to VALUES rows.

What is the new behavior?

Add valuesRowLayout: "expanded" (CLI: --values-row-layout expanded) to put each VALUES tuple on its own indented line. The default remains "fit".

With expanded rows and leading commas:

values
  ('MONTHLY', 1)
  , ('QUARTERLY', 3)
  , ('HALF_YEAR', 6);
  • Honor commaStyle between tuples in both layouts, using the shared comma-separated list helper.
  • Keep short tuples compact and allow long tuples to wrap within lineWidth.
  • Apply the option to INSERT, standalone VALUES, subqueries, and CTEs.
  • Expose the option in the JSON schema, TypeScript bindings, CLI reference, and formatting documentation.

Additional context

  • Regression tests cover both comma styles, tabs, a single row, long tuples, nested statements, comments, and idempotence.
  • Formatter, configuration, and CLI formatting tests pass, as does cargo clippy --all-targets --all-features.
  • All PR CI checks pass, including Linux, macOS, Windows, WASM, generated files, and JavaScript packages.

@psteinroe
psteinroe merged commit 6008e05 into supabase-community:main Oct 15, 2026
9 checks passed
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.

2 participants