jlevy / jlevy/repren

Support separate pattern files for renames vs content replacements

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

Description

## 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.

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.