Skip to content

feat(gmail): add forward command with tests and helpers#167

Open
salmonumbrella wants to merge 23 commits intosteipete:mainfrom
salmonumbrella:feat/gmail-forward
Open

feat(gmail): add forward command with tests and helpers#167
salmonumbrella wants to merge 23 commits intosteipete:mainfrom
salmonumbrella:feat/gmail-forward

Conversation

@salmonumbrella
Copy link
Contributor

@salmonumbrella salmonumbrella commented Feb 2, 2026

Closes #166

Summary

  • Add gmail forward command to forward emails to specified recipients
  • Extract shared resolveSendFrom() helper to reduce code duplication between send/forward
  • Add comprehensive test coverage for forward edge cases (HTML-only, custom subject, CC/BCC)
  • Fix lint issues (shadow declaration, slice preallocation, goconst)

Test plan

  • All existing tests pass (go test ./...)
  • golangci-lint passes with 0 issues
  • New forward tests cover: default subject, attachments, HTML-only messages, custom subject override, CC/BCC recipients

🤖 Generated with Claude Code

salmonumbrella and others added 23 commits January 30, 2026 19:15
- Fix variable shadowing in DocsUpdateCmd (govet: shadow)
- Extract formatAuto constant to satisfy goconst linter

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Cover the readTextInput function and file path expansion logic
by testing DocsWriteCmd and DocsUpdateCmd with temp files.
Also test error cases: non-existent file, empty file, and
mutual exclusion of --text and --file flags.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Test that --index flag properly rejects zero and negative values
with the expected error message.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Distinguish the update command from write by specifying it inserts
text at a specific index position in the document.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add integration tests verifying isDayExpr() integration:
- TestResolveTimeRangeWithDefaultsToTomorrowEndOfDay: verifies
  --to tomorrow expands to end-of-day (23:59:59.999999999)
- TestResolveTimeRangeWithDefaultsToNowNoExpansion: verifies
  --to now does NOT expand to end-of-day (remains current time)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add boolTrue/boolFalse constants for string "true"/"false" values
- Rename shadowed err variable to writeErr in test file

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Rename err to convertErr to avoid shadowing the err variable
declared earlier in the function.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix shadow declaration lint error in forward test
- Add edge case tests: HTML-only, custom subject, CC/BCC
- Extract shared resolveSendFrom() helper to gmail_helpers.go
- Remove redundant subject empty check (dead code)
- Fix slice preallocation lint warnings
- Add defaultAttachmentFilename constant to fix goconst lint

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Add email forwarding support

1 participant