Custom Formatters

daviid's profile image daviid posted 1 month ago in General Permalink

Just like I suggested with exports in thread 41478

Perhaps we could have custom formatting options like

[Formatter Name]
command=
arguments=
file=

Example:

[Formatter Name]
command=python
arguments=["-c", "import sys;import sqlparse;print sqlparse.format(sys.stdin.read(), reindent=True, keyword_case='upper')"]
[Formatter Name]
command=sqlformat
arguments=[ "-", "--reindent", "--keywords", "upper"]
This is stdin^
[Formatter Name]
command=sqlformat
arguments=["file.sql", "--reindent", "--keywords", "upper"]

I like sqlparse's way of formatting but sometimes you can't just use an online source of formatting (due to privacy reasons or just not having internet), so an offline alternative would be cool.

Please login to leave a reply, or register at first.