Skip to content

Feature Request: Keep some blank lines when formatting #750

Open
@arm32x

Description

@arm32x

Describe the Feature
A configuration option (or default behavior) to keep some existing blank lines from the input file. For example, IntelliJ has the following options for Java:
20240619_22h02m40s_grim

Why do you want this feature?
I have some SQL files used for database migrations with a header comment at the top that isn't directly related to the first query:

-- Some header comment
-- with metadata for migrations tool

CREATE TABLE something(id INTEGER PRIMARY KEY);

When I format this with sql-formatter, it currently deletes the blank line between the header comment and the first query.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions