Repository navigation
feat: add delete-list subcommand with --confirm guard - #70
Merged
Merged
Conversation
Deletes a reminders list and every reminder on it. Without --confirm nothing is removed and the command exits 13 (new confirmation_required code) with a summary of what would be deleted. The list must be given by ID or whole name (no substring matching), and the default list and read-only lists are refused. Closes #50
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.
Closes #50
Adds
reminders delete-list <list> [--confirm] [--format plain|json].--confirmnothing is deleted. The command exits13with a newconfirmation_requirederror whose message says what would be removed, e.g.'Groceries' contains 14 reminders (3 completed). Deleting the list deletes all of them.delete-list gro --confirmfails withlist_not_foundand names 'Groceries' in the suggestion. Two lists with the same name arelist_ambiguousinstead of first-wins.invalid_argument, checked before the confirmation): the default list for new reminders, and read-only lists. Resolution runs over all reminder lists so read-only ones get this clear error instead oflist_not_found.Deleted list 'Groceries' (14 reminders), or{calendarIdentifier, deleted, reminderCount, title}with--format json.The deletion rules (
checkListDeletion) and the exact resolver (resolveCalendarExactly) are EventKit-free free functions with unit tests inDeleteListTests. README (new Create a list / Delete a list sections, errors table), SKILL.md (command row, JSON shape, exit 13, and a rule that agents must never pass--confirmwithout the user's OK) and CLAUDE.md are updated.Testing
swift build -Xswiftc -warnings-as-errorsandswift test -Xswiftc -warnings-as-errors(294 tests pass).--confirm→ exit 13 and the list stays; partial name with--confirm→ exit 2 and the list stays; default list (without--confirm) → exit 12; by ID with--confirm→ deleted, plain and JSON output checked; unknown list with--format json→ JSON error on stderr.