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

Non-filepaths matchs #219

Open
arcanis opened this issue Sep 20, 2021 · 3 comments
Open

Non-filepaths matchs #219

arcanis opened this issue Sep 20, 2021 · 3 comments

Comments

@arcanis
Copy link

arcanis commented Sep 20, 2021

Please describe the minimum necessary steps to reproduce this issue:

Ref: yarnpkg/berry#3460

In Yarn, we have a feature that lets our users silence some error messages if they match specific glob pattern. The problem we have is that those messages sometimes feature slashes (for instance, Package name @scope/name isn't allowed). Glob patterns currently don't interact well with those, since Package name * isn't allowed won't match the /. Using ** helps a bit, but not in every case and it feels like a hack.

What should be happening instead?

We'd want an option that would let us instruct micromatch that * are supposed to transpile into .* rather than [^/]* (even better would be to make it configurable, for example if we want * to be [^ ]* and ** to be .*).

@jonschlinkert
Copy link
Member

@dawgwe1 you've been blocked

@micromatch micromatch deleted a comment Sep 25, 2021
@jonschlinkert
Copy link
Member

hi @arcanis, sorry for the late reply

We'd want an option that would let us instruct micromatch that * are supposed to transpile into .* rather than [^/]* (even better would be to make it configurable, for example if we want * to be [^ ]* and ** to be .*).

That seems doable, and shouldn't be too difficult. Just to ensure I understand clearly what you want, you basically just want an option to customize behavior of * and **, so that you can more intelligently match around other non-standard path characters, correct?

I'll be catching up on some issues this week, I'll see if I can implement something for this.

@arcanis
Copy link
Author

arcanis commented Sep 25, 2021

Yep, exactly 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants