Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Define a formatter for SQL (sqlformat) #11
Hey, I remember you from FreeBSD from many years ago! :D Great to see that you're still coding. Thanks for contributing :)
I quickly tested that it works. However, I immediately hit a bug with the formatter itself (sqlparse issue #313, a fix should be coming to pip with version 0.3.0).
The installation command seems to be just:
without a 'py-' prefix.
The FreeBSD port seems to have a 'py-' prefix, as is conventional there. In principle, it's possible to specify a separate install command for FreeBSD, but we currently choose the operating system based on the Emacs
We could also add
to the command line arguments.
Oops, I've removed the superfluous
As for encoding, despite this PR merged, the sqlformat command does not seem to handle UTF-8 well with Python2, so I recommend you use Python3 for now; sqlformat does not (yet) have an
And yes, I still use FreeBSD on my personal server and make commits from time to time.
Thanks for updating the code.
If Python 2 is known to be problematic, we could just change the install command to
I just added a
I installed the latest
Yeah, unfortunately Emacs' GUI framework has needed modernization for 20 years. And font-lock should finally be replaced with a real parsing framework with multi-language support. Young web devs will no longer put up with these things. I hope our venerable editor survives the next decade. MELPA offers a glimmer of hope :)
I've finally got it to work with Python 2.7. I had to set PYTHONIOENCODING for Python <3.2 including 2.7 because the older versions of python wouldn't respect the locale nor default the encoding to UTF-8 when the output is redirected, only to fail in trying to output in ASCII encoding.
That's awesome, thank you for the effort :)
Are you sure
which seems like they are opposite to the intuitive order. Also,
So that's input too. But what is the output encoding, is it always the same as the input encoding, or does it come from
Sorry about all this detail...