fix(ccusage): improve project name handling on windows#819
fix(ccusage): improve project name handling on windows#819vvreutskiy wants to merge 1 commit intoryoppippi:mainfrom
Conversation
📝 WalkthroughWalkthroughThis change fixes Windows path handling in project name parsing. The implementation adds logic to normalize Windows-style absolute paths (with backslashes) and double-dash segments to correctly extract project names, preventing malformed outputs like single letters or dash-separated paths. Tests are added for these scenarios. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #818
Problem:
Windows project names were incorrectly shortened from
C--src--delete--ansibleto justC, losing the actual project name.Solution:
Added proper handling for Windows-style paths in two formats:
C:\work\project→projectC--src--data--project→projectBoth cases now extract the last segment as the project name, matching the behavior for Unix-style paths.
Tests:
Added test cases covering both Windows path formats in arbitrary directories.
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.