Conversation
|
Thank you. Looks good to me. The only thing is that (add-hook 'sql-mode-hook
(lambda ()
(setq format-all-formatters
'(("SQL" (sqlfluff "--dialect=postgres" "--config=/path/to/config.ctg")))))) |
|
I am glad to contribute, I've been a user for several years by now :) The code above doesn't seem to work for me. I tried running (add-hook 'sql-mode-hook
(lambda ()
(setq format-all-formatters
'(("SQL" (sqlfluff "fix" "--config=/path/to/config.ctg" "--ignore=parsing,templating" "--nocolor" "-")))
)
)
)Which gave the output: Also, is there a way to use the linter output even when there is an error? (add-hook 'sql-mode-hook
(lambda ()
(define-format-all-formatter sqlfluff
(:executable "sqlfluff")
(:install "pip install sqlfluff")
(:languages "SQL")
(:features)
(:format (format-all--buffer-easy executable
"fix"
"--config=/path/to/config.ctg"
"--ignore=parsing,templating"
"--nocolor"
"-"
"2>/dev/null" ;; avoid error checking, a bit risky
)
)
)))Regarding |
This pull request adds support for SQLFluff.
There are some problems though. The only way I found to format files with a custom configuration template (which is probably what most users working on production databases would like) was: