Repository navigation
feat(lock): add --check to detect a stale lock offline - #104
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 10 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
myuron
force-pushed
the
feat/lock-check
branch
from
October 17, 2026 04:53
c5067a0 to
de8b3fb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nvimx-lock --checkreports, offline and without writing anything, whether the committed lock still matches the lazy spec. It is meant for pre-commit hooks and CI.How it works
resolve.lua --offlinethen writes a candidateplugins.jsoninto the sandbox, and a newlua/nvimx/check.luacompares it with the committed one.--offlineskips only thegit ls-remotebatch. Semver grammar validation still runs, so an invalidversion = 1.2fails--checkjust as it fails a real lock.resolve.luakeeps--checkfrom drifting from what a real lock writes. Every entry field exceptresolvedRefcomes from the spec alone.What counts as stale
resolvedRef, including a switch between local and remote.plugins.jsonandflake.locknot matching.What is ignored on purpose:
resolvedRef,warnings,flake.nix, and whether the revs inflake.lockare current. A changed constraint is reported, never re-resolved.Offline guarantee
--checknever runsgit ls-remote,genflake,nixfmtornix.nix eval. In--checkthat lookup is skipped, and extraction uses nvimx's bundled lazy.nvim. The README notes the trade-off: a spec that relies on a newer lazy.nvim feature could extract differently.Exit codes
0: up to date.1: stale, or no lock yet. It ends with the refresh line.2: usage error. That includes combining--checkwith--update,--import-lazy-lockor--summary-json.Real failures keep the existing "failed" last line.
Untracked config files (#33)
The untracked-config warning is now a shared
warn_untracked_configfunction, called from both the plain-lock path and--check. In--checkit only warns: the exit code, stdout and the verdict line are unchanged. So the README's suggested hooknvimx-lock --check || nvimx-lock …still surfaces an untracked spec file.Tests
New
checks.lock-check(tests/checks/lock-check.nix+scripts/lock-check.sh).nixrecords every call. An empty argv after each--checkrun proves nix was never called, including the fix(lock): use the locked lazy.nvim as the extraction seed #101 seed lookup.versionremote proves nogit ls-remoteruns.--updatelock pass;flake.lock;lazyNviminto the name map;--check.Verification
nix fmt -- --ci,nix flake checknix build .#checks.x86_64-linux.{lock-check,lock-app,lock-lazy-seed,lock-untracked-config,update-summary-json},nix eval .#checks.aarch64-darwin.lock-check.drvPathCloses #78
🤖 Generated with Claude Code