This repository has been archived by the owner on Aug 12, 2023. It is now read-only.
Supports server tools #1043
okuramasafumi
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
So it seems like based on the documentation, diff --git a/lua/null-ls/builtins/diagnostics/rubocop.lua b/lua/null-ls/builtins/diagnostics/rubocop.lua
index c92f907..4420477 100644
--- a/lua/null-ls/builtins/diagnostics/rubocop.lua
+++ b/lua/null-ls/builtins/diagnostics/rubocop.lua
@@ -60,9 +60,9 @@ return h.make_builtin({
filetypes = { "ruby" },
generator_opts = {
command = "rubocop",
- args = { "-f", "json", "--force-exclusion", "--stdin", "$FILENAME" },
+ args = { "--server", "-f", "json", "--force-exclusion", "--stdin", "$FILENAME" },
to_stdin = true,
- format = "json",
+ format = "json_raw",
check_exit_code = function(code)
return code <= 1
end, At a minimum, it looks like the first run will always fail because the following line is added to the output, which makes JSON parsing fail:
There's some other weird behavior (error messages that I had to suppress with |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Recently, RuboCop, a linter for Ruby, started to offer a server mode, where RuboCop accepts requests at some port.
I tried to use it with null-ls but I just got some error message, but I wasn't surprised because it works quite differently from the original non-server behavior.
I'm not familiar with other tools but they might support server feature in some forms in the future. So, I think it's better that null-ls supports tools that work as servers. Is it possible?
Beta Was this translation helpful? Give feedback.
All reactions