Skip to content

fix(types): fix some type annotations - #2124

Open
plsplsplslol wants to merge 2 commits into
folke:mainfrom
plsplsplslol:main
Open

plsplsplslol wants to merge 2 commits into
folke:mainfrom
plsplsplslol:main

Conversation

@plsplsplslol

Copy link
Copy Markdown

Description

The version type should be string|false like in the documentation https://lazy.folke.io/spec#spec-versioning
This fixes a type error in manage/git.lua

  if version then
    local last = Semver.last(M.get_versions(plugin.dir, version)) -- version should only be a string here

ProcessOpts args should be optional, since the nil case is already handled in Process.new in manage/process.lua
This fixes a few places in manage/git.lua where args is not supplied

function M.count(repo, commit1, commit2)
  local lines = Process.exec({ "git", "rev-list", "--count", commit1 .. ".." .. commit2 }, { cwd = repo }) -- warning: args field missing
  return tonumber(lines[1] or "0") or 0
end

function M.age(repo, commit)
  local lines = Process.exec({ "git", "show", "-s", "--format=%cr", "--date=short", commit }, { cwd = repo }) -- warning: args field missing
  return lines[1] or ""
end

Related Issue(s)

Screenshot

@github-actions github-actions Bot added the size/s Small PR (<10 lines changed) label Jan 30, 2026
@plsplsplslol plsplsplslol changed the title Fix some type annotations fix(types): Fix some type annotations Jan 30, 2026
@plsplsplslol plsplsplslol changed the title fix(types): Fix some type annotations fix(types): fix some type annotations Jan 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s Small PR (<10 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant