Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lua/coverage/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ local defaults = {
php = {
coverage_file = "coverage/cobertura.xml",
path_mappings = {},
},
sh = {
coverage_file = "coverage/lcov.info",
}
},
lcov_file = nil,
Expand Down
27 changes: 27 additions & 0 deletions lua/coverage/languages/sh.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
local M = {}

local Path = require("plenary.path")
local common = require("coverage.languages.common")
local config = require("coverage.config")
local util = require("coverage.util")

--- Returns a list of signs to be placed.
M.sign_list = common.sign_list

--- Returns a summary report.
M.summary = common.summary

--- Loads a coverage report.
-- @param callback called with the results of the coverage report
M.load = function(callback)
local sh_config = config.opts.lang.sh
local p = Path:new(util.get_coverage_file(sh_config.coverage_file))
if not p:exists() then
vim.notify("No coverage file exists.", vim.log.levels.INFO)
return
end

callback(util.lcov_to_table(p))
end

return M