Closed cosven closed 10 months ago
It looks like sqlformat
has been designed so that it has no default behavior. I agree that it is confusing, but this problem should probably be solved upstream in sqlformat
itself. Format-all tries to be neutral and unopinionated about options. You can use different flags by setting format-all-formatters
.
Several people have been confused by sqlformat, so it should probably be covered in thee readme.
Example:
(eval-after-load 'format-all
'(add-hook 'sql-mode-hook
(lambda ()
(setq format-all-formatters
'(("SQL" (sqlformat "-r")))))))
I added the example to the README.
Then I think we can close this PR.
Commit 7d95da8
Before, sqlformat almost does nothing when format sql files. After adding the -r option, the sql can be correctly formatted.
For example, using SQL
Without this change, the sql is not formatted. After this change, it can be formatted to