-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: consolidate scattered hard-coded constants #48
Copy link
Copy link
Closed
Description
Summary
Constants duplicated across multiple files.
Current State
Duplicated constants:
- OAuth scopes in 3 files (gmail, calendar, contacts clients)
- File permissions scattered:
0755for directories0644for files0600for tokens0700for config dirs
- Config directory name
"google-readonly"in 4 files
Problems
- Changing a permission requires finding all occurrences
- Risk of inconsistent values
- Magic numbers reduce code readability
Proposed Solution
Create internal/constants or add to internal/config:
const (
// Directory permissions
ConfigDirPerm = 0700
OutputDirPerm = 0755
// File permissions
TokenFilePerm = 0600
OutputFilePerm = 0644
// OAuth scopes
GmailScope = gmail.GmailReadonlyScope
CalendarScope = calendar.CalendarReadonlyScope
ContactsScope = people.ContactsReadonlyScope
)Priority
P3 - Code organization
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels