-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/#36 unify style prompts #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add message-formatter.ts for consistent CLI output styling - Replace raw ANSI codes with chalk in diff-display.ts - Standardize emoji usage across all commands (10 distinct types) - Implement color scheme (red=error, green=success, yellow=warning, cyan=info) - Translate Japanese comments/messages to English in backup.ts - Refactor all console output to use msg.* helpers - Add verbose mode support with debug messages 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add displayColoredCodeBlock function to parse markdown code blocks - Display code with green + prefix and dim backticks - Apply to INSERT_CODE_BLOCK and default preview cases - Improve visual clarity when previewing code insertions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Detect CODE_REF comment changes with arrow (→) - Display old CODE_REF in red, arrow in yellow, new CODE_REF in green - Highlight CODE_REF: label in cyan bold for single comments - Dim HTML comment markers (<!-- and -->) - Improve visual clarity when reviewing fix options 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…NTENT_MISMATCH When Option 2 is selected for CODE_CONTENT_MISMATCH errors (converting symbol reference to line numbers), the preview now displays a diff showing: - The code block that will be kept (from markdown) - The actual code in the file at the new line numbers This makes it clear to users that the code block needs manual adjustment after updating the CODE_REF comment to use line numbers instead of symbol references. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ISMATCH When Option 2 is selected for CODE_CONTENT_MISMATCH errors (converting symbol reference to line numbers), the preview was incorrectly showing both expected and actual code as the same. Root cause: The switch statement was using error.type instead of action.type, which caused it to hit the CODE_CONTENT_MISMATCH case handler instead of the UPDATE_LINE_NUMBERS case handler. This resulted in comparing error.expectedCode (1 line from document) with action.newCodeBlock (also 1 line from document) instead of extracting the actual code from the file (4 lines with JSDoc). Changes: - Switch on action.type instead of error.type in displayFixPreview - Add special handling for CODE_LOCATION_MISMATCH within UPDATE_LINE_NUMBERS case - Remove unused displayLineRangeDiff import - Update test to use flexible string matching for colored output Now correctly displays: - Expected code (in document): 1 line without JSDoc - Actual code (in file): 4 lines with JSDoc comment 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
When Option 2 is selected for CODE_CONTENT_MISMATCH (convert symbol to line numbers), the previous behavior showed a confusing diff between document code and file code, making users think the code block would be updated. However, Option 2 only updates the CODE_REF comment and keeps the code block unchanged. Changes: - Remove code diff display for UPDATE_LINE_NUMBERS from CODE_CONTENT_MISMATCH - Show clear warning message that code block will remain unchanged - Remove unused extractLinesFromFile import This makes it clear that: - Option 1: Updates both CODE_REF and code block - Option 2: Updates only CODE_REF, code block needs manual adjustment 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add note about color-coded output in CLI usage guide - Describe standardized color schemes and emoji indicators - Update following introduction of centralized message formatter
Pull Request ReviewThank you for this PR! This is a well-structured refactoring that significantly improves the consistency and maintainability of CLI output. Strengths1. Excellent Architecture
2. Code Quality
3. Improved User Experience
4. Good Refactoring
Issues and Concerns1. Missing Test Coverage (HIGH PRIORITY) The new message-formatter.ts module (237 lines) has NO test coverage. This is a significant gap. Recommendation: Create src/utils/message-formatter.test.ts with tests for each message type, verbose mode behavior, complex formatters, and edge cases. 2. Redundant Verbose Check (Low Priority) In src/cli/fix.ts:223, the explicit options.verbose check is redundant since msg.debug() already checks verbose mode internally. 3. Breaking Change Not Documented (Medium Priority) The backup.ts error messages changed from Japanese to English. Should be documented in PR description or CHANGELOG. 4. Verbose Mode State The verbose flag is stored as static state which could cause issues in testing. Consider adding a reset method. Additional Observations
RecommendationsMust Fix:
Should Fix: Nice to Have: Overall AssessmentThis is a high-quality refactoring with sound architectural decisions, clean code, and good documentation. The only significant concern is missing test coverage for the new module. Score: 8/10 (would be 9.5/10 with test coverage) Great work on this PR! |
Add 48 test cases covering: - Basic message formatting (error, warning, info, success, neutral) - Verbose mode and debug functionality - Error detail formatting with optional location - Summary formatting with backup paths - Specialized messages (startFix, startValidation, file, backup, skip, context) - msg convenience export - COLOR_SCHEMES export - Special character handling (HTML, newlines, Unicode) - Edge cases (long messages, large numbers, many backups) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Pull Request Review: Feature/#36 Unify Style PromptsOverviewThis PR successfully centralizes message formatting and styling across the CLI by introducing a new ✅ Strengths1. Excellent Code Organization
2. Comprehensive Test Coverage
3. Consistent Styling Across CLI
4. Good Documentation
5. Improved UX Features
🔍 Code Quality ObservationsMinor Issues
🐛 Potential BugsNone identified - The code changes look solid with no obvious bugs. ⚡ Performance ConcernsNo significant concerns. The changes are primarily cosmetic/formatting:
🔒 Security ConcernsNo security issues identified. The changes deal with display formatting only and don't:
🧪 Test Coverage AssessmentExcellent test coverage with a few notes:
📚 Documentation Needs
📊 Code Metrics
The line count increase is justified by:
🎯 Adherence to Coding StandardsBased on ✅ Style Compliance
✅ Best Practices
🎨 Suggestions for Enhancement
✅ RecommendationAPPROVE with minor suggestions This is a high-quality PR that significantly improves the codebase:
The minor issues identified are not blockers and could be addressed in follow-up PRs if desired. Closes #36 ✅ 🔄 Optional Follow-up TasksConsider creating issues for:
Great work on this refactor! 🎉 |
|
🎉 This PR is included in version 0.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Issue
closes #36