Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Comments inside of --fmt:off blocks are still formatted #136

Closed
tconbeer opened this issue Feb 22, 2022 · 0 comments · Fixed by #452
Closed

Bug: Comments inside of --fmt:off blocks are still formatted #136

tconbeer opened this issue Feb 22, 2022 · 0 comments · Fixed by #452
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@tconbeer
Copy link
Owner

Describe the bug
The --fmt: off tags should stop all formatting of the contained code, but today that is not the case, since comments may be rendered differently in those blocks

To Reproduce

-- fmt: off
where something_long = something_else_long -- and there is a long comment that should stay on this line
-- fmt: on

Expected behavior

-- fmt: off
where something_long = something_else_long -- and there is a long comment that should stay on this line
-- fmt: on

Actual behavior

-- fmt: off
-- and there is a long comment that should stay on this line
where something_long = something_else_long
-- fmt: on

Additional context
What is the output of sqlfmt --version?
0.5.1

@tconbeer tconbeer added the bug Something isn't working label Feb 22, 2022
@tconbeer tconbeer added the good first issue Good for newcomers label Mar 1, 2023
tconbeer added a commit that referenced this issue Jul 13, 2023
* chore: bump deps

* fix #447: early stop all fmt options if fmt is disabled

* fix #136: don't format comments in fmt off blocks

* fix: clean up newline handling in comments'

* fix: restore comment formatting for data tokens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant