PabloRMira / sql_formatter

A Python based SQL formatter
https://pablormira.github.io/sql_formatter/
Apache License 2.0
43 stars 10 forks source link

reformating of long lines with in (...) not working #153

Closed PabloRMira closed 3 years ago

PabloRMira commented 3 years ago

Describe the bug

Reformatting of long lines with in (...) not working

To Reproduce

The following long line with in (...) does not get properly reformatted (break line)

select asdf, case when asdf in ('1231', '123123', '12312', '21412431234', '12341234123', '12341234', '12341234', '1234') then 1 else 0 end as qwer, asdf2

but rather

SELECT asdf,
       case when asdf in ('1231', '123123', '12312', '21412431234', '12341234123', '12341234', '12341234', '1234') then 1
            else 0 end as qwer,
       asdf2;

Expected behavior

SELECT asdf,
       case when asdf in ('1231', '123123', '12312', '21412431234', '12341234123', '12341234', '12341234',
                          '1234') then 1
            else 0 end as qwer,
       asdf2;