Summary
Currently, the same patterns are applied to both file content replacements and file path renames (when using --full). There is no way to specify different patterns for each operation.
Details
There is a TODO at line 1638 of repren.py:
# Separate patterns file for renames and replacements
Use cases where separate patterns would be useful:
- Renaming files according to one convention while replacing content with a different pattern
- Using regex features in content patterns that don't make sense for file paths
- Applying broader patterns to content but more conservative patterns to filenames (to avoid accidental directory restructuring)
Suggestion
Add an optional --rename-patterns flag (or --content-patterns) that allows specifying a separate patterns file for renames vs content replacements. When not specified, the existing behavior (same patterns for both) would be preserved.
Summary
Currently, the same patterns are applied to both file content replacements and file path renames (when using
--full). There is no way to specify different patterns for each operation.Details
There is a TODO at line 1638 of
repren.py:Use cases where separate patterns would be useful:
Suggestion
Add an optional
--rename-patternsflag (or--content-patterns) that allows specifying a separate patterns file for renames vs content replacements. When not specified, the existing behavior (same patterns for both) would be preserved.