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
{{ message }}
Repository navigation
comma_first option for reindent_aligned would be sweet #490
While I am thrilled that this library has the aligned indent option, which is something I've been searching for in a SQL formatter, I'm also from the commas-first school. In fact, this works even better with aligned indentation, as the commas line up right under the keywords, with the identifiers and literals on the right all by themselves.
For example:
select j.jobtitle
, count(*)
, max(orig_salary) maxsalary
, min(orig_salary) minsalary
, rank() over(order by max(orig_salary)) rankorder
from employee e
, job j
where e.orig_salary < 43000
and e.empno = j.empno
group by j.jobtitle
having max(orig_salary) > 34000
order by j.jobtitle desc
;
I think this format also makes semantic sense, as the commas are really syntactic elements as much as the keywords are. YMMV, but in any case I for one would love to be able to get this format automatically, which neither the aligned indent nor regular reindent with comma_first quite does now.
Reacted by Henry Zhu, Gabe Schenz, gytsvetkov and Thomas Yager-Madden
Activity