-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
refactoringCode refactoring without changing functionalityCode refactoring without changing functionalitytech-debtTechnical debt that needs addressingTechnical debt that needs addressing
Milestone
Description
Part of SRP Refactoring (Priority 2: CLI Layer)
Current Problem
safety_check()
in src/cli/main.c combines path checking, git config, error display, and enforcement in one function.
Refactoring Plan
Split into focused functions:
validate_working_directory()
- Path validation onlycheck_remote_safety()
- Remote URL validationenforce_safety_policy()
- Decision logic onlyreport_safety_violation()
- Error formatting/display
Acceptance Criteria
- Each validation step isolated
- Policy decisions separated from checks
- Error reporting extracted
- Easier to test each validation
- Clear separation of concerns
- Improved error messages
Technical Notes
- Consider policy configuration
- Make validators reusable
- Return structured error information
Related to SRP_REFACTORING_PLAN.md Priority 2.1
Metadata
Metadata
Assignees
Labels
refactoringCode refactoring without changing functionalityCode refactoring without changing functionalitytech-debtTechnical debt that needs addressingTechnical debt that needs addressing