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

Don't merge lines if they contain a trailing comma #569

Open
ryaminal opened this issue Mar 19, 2024 · 3 comments
Open

Don't merge lines if they contain a trailing comma #569

ryaminal opened this issue Mar 19, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@ryaminal
Copy link

Snowflake now supports trailing commas. See this for more info.

example(from the link above):

select emp_id,
       name,
       dept,
from employees;

Curious on what is desired in sqlfmt to support this? Maybe nothing needs to be done? I'm not certain.

@tconbeer
Copy link
Owner

when I format your example, I get:

select emp_id, name, dept,
from employees
;

What would you like to see? Do you want to enforce the presence of a trailing comma? Or treat it like black's magic trailing comma (to prevent collapsing onto one line)?

@ryaminal
Copy link
Author

mostly just curious if anything needs to be changed from sqlfmt's perspective to support this. didn't want the trailing comma to be removed because it's now valid.
and yeah, i saw the same result and that's why i wasn't certain if anything needs to be done.

@tconbeer
Copy link
Owner

tconbeer commented Apr 5, 2024

I don't think we need to change anything, but I'll leave this open as a feature request for a "magic trailing comma" feature

@tconbeer tconbeer changed the title Snowflake Trailing Comma Don't merge lines if they contain a trailing comma Apr 5, 2024
@tconbeer tconbeer added the enhancement New feature or request label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants