Setting up a formatter that outputs errors #231
-
I am setting up a formatter that outputs an error in addition to the formatted output. However, the formats are not being applied. Here is my config. I have null_helpers.make_builtin({
method = null_methods.internal.FORMATTING,
filetypes = { "sql" },
generator_opts = {
to_stdin = true,
ignore_stderr = true,
suppress_errors = true,
command = "${pkgs.sqlfluff}/bin/sqlfluff",
args = {
"fix",
"-",
},
},
factory = null_helpers.formatter_factory,
}), This is the output from the debug logs. So it clearly is running but nothing gets applied when I call
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Can you post an example of a file to recreate the issue? I'm using the following simplified setup and it seems to be working: local null_ls = require("null-ls")
local sqlfluff = {
method = null_ls.methods.FORMATTING,
filetypes = { "sql" },
generator = null_ls.formatter({
to_stdin = true,
ignore_stderr = true,
command = "sqlfluff",
args = {
"fix",
"-",
},
}),
} |
Beta Was this translation helpful? Give feedback.
-
Are you sure this is an issue with null-ls and not |
Beta Was this translation helpful? Give feedback.
Are you sure this is an issue with null-ls and not
sqlfluff
itself? I tried pasting the content into a file and runningcat test.sql | sqlfluff fix -
from the command line and got the same results. I can see that other fixable errors like unnecessary whitespace are correctly fixed, so unless I'm misunderstanding something, I'm not sure that this is a null-ls issue.