feat: adopt Neovim plugin best practices#23
Merged
Conversation
zuqini
added a commit
that referenced
this pull request
May 18, 2026
Each tests/*_test.lua is now a native busted spec that registers its describe/it blocks at load time, discovered directly via the .busted pattern. This drops the compatibility shim PR #23 left behind: helpers.set_busted, helpers.test/helpers.describe, and the tests/zpack_spec.lua aggregator are gone. Assertions route through busted's bundled luassert, so a failed assertion is now classified as a 'failure' rather than an 'error' — restoring the xUnit failure-vs-error split for triage. assert_table_contains becomes a registered luassert assertion (assert.contains). Fixture setup/teardown moves from inline setup_test_env/cleanup_test_env calls to before_each/after_each, which run uniformly on the passing and failing path and remove the per-test 'remember to clean up' footgun. pack_update_test_helpers.lua now exports parameterised cases() instead of registering describe blocks itself; zupdate_test.lua and zrestore_test.lua drive them as native specs. Suite is unchanged at 379 tests; passes shuffled. luacheck clean. Closes zpack_nvim-8dm
zuqini
force-pushed
the
feat/nvim-best-practices
branch
2 times, most recently
from
May 19, 2026 01:32
d454a30 to
d41ac53
Compare
Audit zpack against the nvim-best-practices checklist and close the gaps, plus harden setup() against malformed input. No behavior change for a correct config — this is robustness, tooling, and CI work. Robustness: - Add validate.lua — advisory type-checking of setup() opts and plugin specs, emitting actionable field-named messages instead of cryptic downstream errors. A leaf module so health.lua can reuse it. - Add health.lua — :checkhealth zpack diagnostics: Neovim version, vim.pack availability, config validity, deprecated options, and plugin status. - setup() no longer aborts on a malformed spec: a spec with no plugin source, a non-string import, or a non-string source is reported and skipped rather than crashing the loader partway through. Tooling & CI: - Add .luarc.json and make lua/ type-clean; lua-language-server --check runs in CI. - Add .luacheckrc and luacheck linting in CI. - Automate releases and the changelog with release-please. - Migrate the test suite from the custom harness to busted. Housekeeping: - Remove goto statements for PUC Lua 5.1 / LuaJIT compatibility.
zuqini
force-pushed
the
feat/nvim-best-practices
branch
from
May 19, 2026 01:49
d41ac53 to
c329797
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
Audits zpack against the nvim-best-practices checklist and closes the gaps, plus hardens
setup()against malformed input. No behavior change for a correct config — this is robustness, tooling, and CI work.What's in here
Robustness
validate.lua— advisory type-checking ofsetup()opts and plugin specs; emits actionable, field-named messages instead of cryptic downstream errors. Intentionally a leaf module (norequires) sohealth.luacan reuse it.health.lua—:checkhealth zpackdiagnostics (Neovim version,vim.packavailability, config validity, deprecated options, plugin status).setup()no longer aborts on a malformed spec: a spec with no plugin source, a non-stringimport, or a non-string source is now reported and skipped rather than crashing the loader partway through.Tooling & CI
.luarc.json+lua/made type-clean;lua-language-server --checkruns in CI..luacheckrc+luachecklinting in CI.release-pleaseautomates releases and the changelog.Housekeeping
gotostatements removed for PUC Lua 5.1 / LuaJIT compatibility.Test plan
nvim -u NONE -l tests/busted.lua— 383 tests pass.luacheck lua/ tests/— clean.lua-language-server --check— clean (runs in CI withVIMRUNTIMEresolved).