You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm not too particular about exactly how you format it, just definitely would prefer it doesn't start in the same line as the previous field, which to me look quite confusing
To Reproduce
select
'xero' as billing_platform,
[ invoice_id, invoice.invoice_number ] as billing_platform_references,
from hello
Expected behavior
select
'xero' as billing_platform,
[ invoice_id, invoice.invoice_number ] as billing_platform_references,
from hello
or
select
'xero' as billing_platform,
[
invoice_id, invoice.invoice_number
] as billing_platform_references,
from hello
Actual behavior
select
'xero' as billing_platform, [
invoice_id, invoice.invoice_number
] as billing_platform_references,
from hello
Additional context
What is the output of sqlfmt --version?
Whatever is live on http://sqlfmt.com
The text was updated successfully, but these errors were encountered:
Interesting, thanks for the report! I'm surprised this happens, since we get it right with parentheses:
-- formattedselect'xero'as billing_platform,
(invoice_id, invoice.invoice_number) as billing_platform_references,
from hello
We also get it wrong when there is an operator (not a comma) in the brackets:
-- expectedselect'xero'as billing_platform,
[invoice_id +invoice.invoice_number] as billing_platform_references,
from hello
-- actualselect'xero'as billing_platform, [
invoice_id +invoice.invoice_number
] as billing_platform_references,
from hello
I need to check (probably in merger.py::_maybe_stubbornly_merge), but it's possible we assume square brackets will follow a name (as the index operation), when clearly that isn't true.
Describe the bug
I'm not too particular about exactly how you format it, just definitely would prefer it doesn't start in the same line as the previous field, which to me look quite confusing
To Reproduce
Expected behavior
or
Actual behavior
Additional context
What is the output of
sqlfmt --version
?Whatever is live on
http://sqlfmt.com
The text was updated successfully, but these errors were encountered: