chore: add type annotations to (almost) all functions

This commit is contained in:
Akmadan23
2023-11-24 12:01:24 +01:00
parent 46e1f776f0
commit fabea3376e
48 changed files with 438 additions and 83 deletions

View File

@@ -6,9 +6,9 @@ local M = {
}
--- Retrieve the git toplevel directory
--- @param cwd string path
--- @return string|nil toplevel absolute path
--- @return string|nil git_dir absolute path
---@param cwd string path
---@return string|nil toplevel absolute path
---@return string|nil git_dir absolute path
function M.get_toplevel(cwd)
local profile = log.profile_start("git toplevel git_dir %s", cwd)
@@ -60,6 +60,8 @@ end
local untracked = {}
---@param cwd string
---@return string|nil
function M.should_show_untracked(cwd)
if untracked[cwd] ~= nil then
return untracked[cwd]
@@ -85,6 +87,9 @@ local function nil_insert(t, k)
return t
end
---@param status table
---@param cwd string|nil
---@return table
function M.file_status_to_dir_status(status, cwd)
local direct = {}
for p, s in pairs(status) do