Skip to content

Support separate pattern files for renames vs content replacements #47

@jlevy

Description

@jlevy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions