sql-formatter
sql-formatter copied to clipboard
[FORMATTING] Missing indent level of comment after CASE
Input data
Which SQL and options did you provide as input?
SELECT
a,
CASE
-- one
WHEN a = 1 THEN 'one'
-- two
WHEN a = 2 THEN 'two'
ELSE 'other'
END
FROM
test;
Expected Output
(unchanged)
SELECT
a,
CASE
-- one
WHEN a = 1 THEN 'one'
-- two
WHEN a = 2 THEN 'two'
ELSE 'other'
END
FROM
test;
Actual Output
-- one is indented one level lesser than expected
SELECT
a,
CASE
-- one
WHEN a = 1 THEN 'one'
-- two
WHEN a = 2 THEN 'two'
ELSE 'other'
END
FROM
test;
Usage
- How are you calling / using the library? Demo on website
- What SQL language(s) does this apply to? PostgreSQL
- Which SQL Formatter version are you using? 15.0.2
Thanks for reporting. This is essentially the same issue as #660