Skip to content

Commit 83c7c00

Browse files
authored
Revert "helpers/factory: default formatter valid exit code to 0 (#221)" (#236)
This reverts commit cc810f7.
1 parent cc810f7 commit 83c7c00

File tree

4 files changed

+4
-42
lines changed

4 files changed

+4
-42
lines changed

lua/null-ls/helpers/check_exit_code.lua

-27
This file was deleted.
+2-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
return function(opts)
2-
local h = require("null-ls.helpers")
3-
42
-- ignore errors unless otherwise specified
53
if opts.ignore_stderr == nil then
64
opts.ignore_stderr = true
75
end
6+
87
-- for formatters, to_temp_file only works if from_temp_file is also set
98
if opts.to_temp_file then
109
opts.from_temp_file = true
@@ -19,10 +18,5 @@ return function(opts)
1918
return done({ { text = output } })
2019
end
2120

22-
if opts.check_exit_code == nil then
23-
opts.check_exit_code = 0
24-
end
25-
opts.check_exit_code = h.check_exit_code(opts.check_exit_code, false, opts.command)
26-
27-
return h.generator_factory(opts)
21+
return require("null-ls.helpers").generator_factory(opts)
2822
end

lua/null-ls/helpers/generator_factory.lua

+2-6
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,11 @@ return function(opts)
132132
opts.temp_dir,
133133
opts.prepend_extra_args
134134

135-
local codes = check_exit_code
136-
if type(codes) == "table" then
135+
if type(check_exit_code) == "table" then
136+
local codes = check_exit_code
137137
check_exit_code = function(code)
138138
return vim.tbl_contains(codes, code)
139139
end
140-
elseif type(codes) == "number" then
141-
check_exit_code = function(code)
142-
return code <= codes
143-
end
144140
end
145141

146142
local is_nil_table_or_func = function(v)

lua/null-ls/helpers/init.lua

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
return {
22
cache = require("null-ls.helpers.cache"),
3-
check_exit_code = require("null-ls.helpers.check_exit_code"),
43
diagnostics = require("null-ls.helpers.diagnostics"),
54
formatter_factory = require("null-ls.helpers.formatter_factory"),
65
generator_factory = require("null-ls.helpers.generator_factory"),

0 commit comments

Comments
 (0)