Skip to content

fix: support -- sql-formatter-disable line comments - #970

Open
cnbei wants to merge 1 commit into
sql-formatter-org:masterfrom
cnbei:fix/line-comment-disable-formatting
Open

fix: support -- sql-formatter-disable line comments#970
cnbei wants to merge 1 commit into
sql-formatter-org:masterfrom
cnbei:fix/line-comment-disable-formatting

Conversation

@cnbei

@cnbei cnbei commented Aug 30, 2026

Copy link
Copy Markdown

Fixes #912

Block comments already supported sql-formatter-disable / enable. Line comments -- sql-formatter-disable did not, so sqlc.embed(users) and similar were still reformatted.

Treat -- sql-formatter-disable ... -- sql-formatter-enable (or EOF) as one DISABLE_COMMENT token so inner SQL is not parsed. Jest: 5944 passed, 1 skipped.

Recognize -- sql-formatter-disable / -- sql-formatter-enable the same way
as block-comment disable markers, so formatting can be skipped without
/* */ comments (issue sql-formatter-org#912).
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.

missing -- sql comment support for disable formatting

1 participant