Repository navigation
Conversation
This was referenced Oct 24, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #946.
#912 listed this as not covered. The snapshot width check (
assert_line_lengthsintests.rs) didn't catch lines past the width in two common cases:json_value(cast('{"a": ...}' as jsonb), '$.a.b'of 95 columns passed at width 80, because most of it was inside quotes.That is how the
json_valuelayout fixed in #898 got through.The new check
common::width_problemsreplaces it. It uses the Postgres lexer and measures the whole line, with tabs counted asindentSizecolumns. A line is only excused when its indentation, its longest token (string literals included) and 12 more columns don't fit. That covers a long literal, a long quoted identifier, a function body, or code nested so deeply that there is no room left. A--comment ending the line is written as in the source and is not counted. The snapshot tests and the option matrix from #912 both use it. The matrix checks width only at 80 and 120 withcastStyle: cast: at 40 some statements can't fit, and a::cast can't break either (select '...'::int8with a compact select list).Formatter changes it needed
The stricter check found these, and they are fixed here:
#-operators running to 206 columns inexplain. The renderer now checks that the text after the last line of such a token fits too.is [not] distinct from,like,ilike,similar to. These now wrap their right-hand side like a comparison operator does, instead of always printing a space.extract,position,overlay,substring,xmlexists). Their arguments are a group inside the call's parentheses, sosecond from cast(...)stays together on the indented line when it fits there, andfromonly breaks when it doesn't.Snapshot changes
All reviewed:
explain,jsonb_jsonpath,misc_functions,tsearch);is [not] distinct from/likewrap before the right-hand side (xid,txid,opr_sanity,strings);extract(field from source)breaks afterfromonly when the arguments don't fit the indented line (timetz,interval).New tests in
width_layout.rscover the check itself,is not distinct from,similar to, and text after a multi-line literal. All fixtures pass the stricter check, and the option matrix passes with it.