Skip to content

Feature Request: make ignore globbing patterns more intuitive for directories #443

@daverayment

Description

@daverayment

Hi,

Let's say I have the following repomix command, which both includes and excludes files:

repomix
    --include "MyProject.Common/**/*,MyProject.Models/**/*,MyProject.UI/**/*"
    --ignore "**/bin,**/obj,**/GeneratedFiles,**/Assets"

That is the correct syntax. However, if I amend the exclusion patterns to include trailing slashes, it does not work:

repomix
    --include "MyProject.Common/**/*,MyProject.Models/**/*,MyProject.UI/**/*"
    --ignore "**/bin/,**/obj/,**/GeneratedFiles/,**/Assets/"

The result of running this is that all files are still included in the folders we've marked to ignore. It is reasonable to assume that **/Assets and **/Assets/ would mark all Assets folders under the include paths for exclusion.

Similarly, the following command will not work either:

repomix
    --include "MyProject.Common/**/*,MyProject.Models/**/*,MyProject.UI/**/*"
    --ignore "**/bin/**/*,**/obj/**/*,**/GeneratedFiles/**/*,**/Assets/**/*"

This uses the same globbing pattern to attempt to exclude files as it does to include files, but no files are excluded.

This caught me out today when using the tool for the first time.

In summary, please make the following --ignore patterns perform identically:

**/folder
**/folder/
**/folder/**/*

Incidentally, the "**/name" syntax for exclusion patterns may be problematic, as it will match both folders and files with that name. It's rare that you have files lacking extensions, of course, but it may be worth noting.

Thank you for your useful tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions