pending.nvim/spec
Barrett Ruth 306e11aee6 feat(sync): backend interface + CLI refactor (#42)
* refactor(sync): extract backend interface, adapt gcal module

Problem: :Pending sync hardcodes Google Calendar — M.sync() does
pcall(require, 'pending.sync.gcal') and calls gcal.sync() directly.
The config has a flat gcal field. This prevents adding new sync backends
without modifying init.lua.

Solution: Define a backend interface contract (name, auth, sync, health
fields), refactor :Pending sync to dispatch via require('pending.sync.'
.. backend_name), add sync table to config with legacy gcal migration,
rename gcal.authorize to gcal.auth, add gcal.health for checkhealth,
and add tab completion for backend names and actions.

* docs(sync): update vimdoc for backend interface

Problem: Vimdoc documents :Pending sync as a bare command that pushes
to Google Calendar, with no mention of backends or the sync table config.

Solution: Update :Pending sync section to show {backend} [{action}]
syntax with examples, add SYNC BACKENDS section documenting the interface
contract, update config example to use sync.gcal, document legacy gcal
migration, and update health check description.

* test(sync): add backend dispatch tests

Problem: No test coverage for sync dispatch logic, config migration,
or gcal module interface conformance.

Solution: Add spec/sync_spec.lua with tests for: bare sync errors,
empty backend errors, unknown backend errors, unknown action errors,
default-to-sync routing, explicit sync/auth routing, legacy gcal config
migration, explicit sync.gcal precedence, and gcal module interface
fields (name, auth, sync, health).
2026-02-26 17:59:04 -05:00
..
archive_spec.lua test: add missing coverage (#19) 2026-02-24 22:33:13 -05:00
complete_spec.lua feat: omnifunc completion, recurring tasks, expanded date syntax (#27) 2026-02-25 13:27:52 -05:00
diff_spec.lua feat: omnifunc completion, recurring tasks, expanded date syntax (#27) 2026-02-25 13:27:52 -05:00
edit_spec.lua feat: :Pending edit command for CLI metadata editing (#41) 2026-02-26 16:34:07 -05:00
helpers.lua test: add store, parse, and diff specs 2026-02-24 15:10:09 -05:00
parse_spec.lua feat: time-aware due dates, persistent undo, @return audit (#33) 2026-02-25 20:37:50 -05:00
recur_spec.lua feat: omnifunc completion, recurring tasks, expanded date syntax (#27) 2026-02-25 13:27:52 -05:00
status_spec.lua feat: statusline API, counts, and PendingStatusChanged event (#40) 2026-02-26 16:30:06 -05:00
store_spec.lua feat: omnifunc completion, recurring tasks, expanded date syntax (#27) 2026-02-25 13:27:52 -05:00
sync_spec.lua feat(sync): backend interface + CLI refactor (#42) 2026-02-26 17:59:04 -05:00
textobj_spec.lua feat: text objects and motions for the pending buffer (#39) 2026-02-26 16:28:58 -05:00
views_spec.lua feat: omnifunc completion, recurring tasks, expanded date syntax (#27) 2026-02-25 13:27:52 -05:00