Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question / bug for file-globs #397

Open
adamhill opened this issue Mar 8, 2025 · 1 comment
Open

question / bug for file-globs #397

adamhill opened this issue Mar 8, 2025 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@adamhill
Copy link

adamhill commented Mar 8, 2025

I am trying to get a simple fileglob to work.

It does not work on the command line, it does work in repomix.config.json

CLI:
I have tried both

--ignore "**/__tests__/**, **/theme/**"
and
 --ignore "**/{__tests__, theme}/**" 

(the second syntax is from the fastglob repo linked in the readme as an example)
Does not work

repomix.config:

"customPatterns": ["**/__tests__/**", "**/theme/**"]

Does work

What am I missing?

@yamadashy yamadashy added bug Something isn't working enhancement New feature or request labels Mar 9, 2025
@yamadashy
Copy link
Owner

Hi, @adamhill !
Thank you for your report.

I believe this should work:

--ignore "**/__tests__/**,**/theme/**"

The issue is that repomix's ignore parsing is simply using split(',') without any whitespace trimming. This means that:

--ignore "**/__tests__/**, **/theme/**"

Will result in patterns like **/__tests__/** and **/theme/** (note the leading space in the second pattern).

And similarly, a pattern like:

**/{__tests__, theme}/**

Gets split incorrectly.

While the latter input syntax is more challenging to support, I plan to improve the parser to trim whitespace after split(',') so the first pattern style works as expected. There should be very few cases where leading or trailing spaces are actually needed in patterns, and in those rare cases, \s can be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants