Added better documentation for linting

This commit is contained in:
2025-10-23 22:18:48 +02:00
parent 7b822746d3
commit 8cde56a4e8
2 changed files with 37 additions and 20 deletions

View File

@ -1,5 +1,5 @@
local core = require "core"
local process = require "process"
local process = require "process"
---@class M
local M = {
@ -7,6 +7,10 @@ local M = {
}
-- Run a shell command
---@param cmd table|string List of command pieces or in full
---@param opts table Options to run the command. Should contain env (table), cwd (string), stdout and stdin
---@param name string Name of the target to run
---@return process|nil
function M:run(cmd, opts, name)
core.log("[jpdebug] Running shell command")
if cmd then
@ -18,26 +22,32 @@ function M:run(cmd, opts, name)
end
-- Wait untill it ends, possibly with timeout
---@param proc process Process object
---@param time any Time field, process.WAIT_INFINITE
function M:wait(proc, time)
return proc:wait(time)
end
-- Read the stdout, returns nil if process has stopped
---@param proc process Process object
function M:read_stdout(proc)
return proc:read_stdout()
end
-- Read the stderr
---@param proc process Process object
function M:read_stderr(proc)
return proc:read_stderr()
end
-- Kill the process
---@param proc process Process object
function M:kill(proc)
proc:kill()
end
-- Terminate the process
---@param proc process Process object
function M:terminate(proc)
proc:terminate()
end