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

Formatting case statement is inaccurate #15

Open
bogdan opened this issue Mar 4, 2024 · 1 comment
Open

Formatting case statement is inaccurate #15

bogdan opened this issue Mar 4, 2024 · 1 comment
Assignees

Comments

@bogdan
Copy link

bogdan commented Mar 4, 2024

When formatting CASE WHEN THEN structure THEN and WHEN from different conditions are put to the same line:

SELECT
    CASE
      WHEN a > 0
      THEN 'above' WHEN a < 0
      THEN 'below'

I think this is inaccurate and I would expect the following instead:

SELECT
    CASE
      WHEN a > 0 THEN
         'above' 
      WHEN a < 0 THEN 
         'below'
@sonota88
Copy link
Owner

Thank you for reporting this issue. I would like to improve this.

From a quick glance, it appears that a quick hack is not sufficient. It may take time to properly address this issue.

The current code is complex and will likely require additional test cases and refactoring first.

@sonota88 sonota88 self-assigned this Jan 12, 2025
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

No branches or pull requests

2 participants