Commit 537275f
feat: implement contextual separator coercion
Fixes the critical issue where refaktor-core was renamed to
smart_search_and_replace-core (mixed separators) instead of
smart-search-and-replace-core (consistent hyphens).
Key features:
- Automatic style detection (kebab-case, snake_case, PascalCase, etc.)
- Context-aware coercion maintains container naming conventions
- Smart file extension handling for proper style detection
- Case-insensitive multi-occurrence replacement
- Dot-case exclusion by default (risky for extensions)
- Integration with both content matches and file/directory renames
Comprehensive test coverage includes:
- Critical test case: refaktor-core → smart-search-and-replace-core
- Various container styles and edge cases
- End-to-end repository scanning with coercion
- File/directory rename coercion
- Content match coercion within code
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 8f9b8d3 commit 537275f
11 files changed
Lines changed: 906 additions & 16 deletions
File tree
- refaktor-cli/src
- refaktor-core
- src
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
6 | 19 | | |
7 | 20 | | |
8 | 21 | | |
| |||
30 | 43 | | |
31 | 44 | | |
32 | 45 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| |||
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
78 | | - | |
| 82 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| 401 | + | |
401 | 402 | | |
402 | 403 | | |
403 | 404 | | |
| |||
0 commit comments