chore: add type annotations to (almost) all functions
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user