Commit: 70f1b05252578ccae2f97723c878167ac261e1ac
Parent: f71e11b5f1003abaa289f5c8615193bfad72d3a3
Author: Rivera Calzadillas
Date: Fri, 3 Nov 2023 18:37:07 -0600
Output: print the total number of failures when all commands are done
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/init.lua b/init.lua
@@ -57,6 +57,7 @@ local run_actions_on_file = function(actions, file, range, modify)
local prefix = "--- "
lint.logger(prefix .. "vis-lint: (" .. os.date() .. ")")
local all_succeeded = true
+ local failure_count = 0
for _, cmd in ipairs(cmds) do
lint.logger(prefix .. "piping "
.. (file.name or "buffer")
@@ -65,6 +66,7 @@ local run_actions_on_file = function(actions, file, range, modify)
local ret = run_on_file(cmd, file, range, modify)
if ret ~= 0 then
all_succeeded = false
+ failure_count = failure_count + 1
-- exit early if modify was specified
if modify then
lint.logger("Command failed with exit code: " .. ret, lint.log.ERROR)
@@ -72,7 +74,7 @@ local run_actions_on_file = function(actions, file, range, modify)
end
end
end
- lint.logger(prefix .. "done")
+ lint.logger(prefix .. #cmds .. " commands done, " .. failure_count .. " reported a problem")
return all_succeeded
end