Skip to content

Move default excludes and copy-without-render patterns to config file #122

Description

@raiderrobert

Problem

Default exclude patterns (DEFAULT_EXCLUDES) and copy-without-render patterns (DEFAULT_COPY_WITHOUT_RENDER) are hardcoded in src/extract/exclude.rs. Every time a new tool invents a cache/worktree directory (.astro, .claude/worktrees, .turbo, .next, etc.), it requires a code change, recompile, and release.

Proposed Solution

Move these patterns to a layered config system:

  1. Hardcoded minimal set — just the truly universal patterns (.git, node_modules)
  2. User-level config~/.config/diecut/config.toml with default_excludes and default_copy_without_render arrays that extend the built-in defaults

This follows the existing XDG convention (~/.cache/diecut/ already exists for template caching).

Example config

[extract]
default_excludes = [
    ".astro",
    ".claude/worktrees",
    ".turbo",
    ".next",
    ".nuxt",
    # ...
]

default_copy_without_render = [
    "*.lock",
    "pnpm-lock.yaml",
    "Cargo.lock",
    # ...
]

Users could add project-specific or tool-specific patterns without waiting for a diecut release.

Current Location

src/extract/exclude.rsDEFAULT_EXCLUDES and DEFAULT_COPY_WITHOUT_RENDER constants.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions