Skip to content

--exclude replaces the project config's exclude list instead of merging — excluding nothing *adds* files #150

Description

@JordanCoin

Version: 4.4.2 (Homebrew) · macOS

Summary

A CLI --exclude overrides .codemap/config.json's exclude array rather than adding to it. Passing a pattern that matches nothing therefore increases the file count, because the project's own exclusions stop applying.

Repro

In a repo whose .codemap/config.json has a non-empty exclude list (mine excluded a vendor directory and a submodule path):

codemap .                        # Files: 143
codemap --exclude ZZZNOMATCH .   # Files: 159

Expected

--exclude ZZZNOMATCH matches no path, so the count should stay 143. Excluding more should never yield more.

Actual

159 — the 16 files the project config was excluding reappear.

Impact

Quiet rather than dramatic, but it means --exclude cannot be used to narrow a scan on any repo that has a config file: every use silently widens the scan first. It also makes --exclude results non-comparable to bare codemap . output, which is exactly when you'd reach for it.

Suggested fix

Union the two lists. If replacing is ever wanted, make it explicit — --exclude-only, or a documented note in --help that the flag overrides project config.

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