jlevy / jlevy/repren

--preserve-case enhancement: also use underscore-less CamelCase translations

Open
#9 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
374
Forks
39
Avg merge
3m
Merged PRs (30d)
1

Description

Currently, when `--preserve-case` is used to translate a CamelCase replacements to additional lowercase and uppercase replacements, it inserts underscores in between the word segments. This is cool, but on some occasions it would be useful to additionally do the replacement without the added underscores.

For example, the current behaviour is like this:

```
$ repren --full --from CamelCase --to DromedaryCase --preserve-case .
Using 4 patterns:
'CAMEL_CASE' -> 'DROMEDARY_CASE'
'CamelCase' -> 'DromedaryCase'
'camelCase' -> 'dromedaryCase'
'camel_case' -> 'dromedary_case'
```

It would be awesome if it could be extended to do this:

```
$ repren --full --from CamelCase --to DromedaryCase --preserve-case .
Using 6 patterns:
'CAMEL_CASE' -> 'DROMEDARY_CASE'
'CAMELCASE' -> 'DROMEDARYCASE'
'CamelCase' -> 'DromedaryCase'
'camelCase' -> 'dromedaryCase'
'camel_case' -> 'dromedary_case'
'camelcase' -> 'dromedarycase'
```

Perhaps this could be opt-in.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.