Skip to content

Do not merge lines with more than N segments #305

@tconbeer

Description

@tconbeer

We aggressively merge lines if they fit, even if those lines are very complex:

select a, b, c, case when a > b then c else a end as d from e where a > 1 and b > 2

I'm not sure this is a good idea. The example above has 3 top-level segments (select, from, where) and the select segment has 4 segments. Maybe we should check the number of segments (either after we split into segments or before merging them) and skip merging across segments if there are more than N (where N is probably 3-4).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requeststylefor issues that change the sqlfmt style

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions