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

Support exclude patterns #2003

Open
rrousselGit opened this issue Apr 19, 2023 · 5 comments
Open

Support exclude patterns #2003

rrousselGit opened this issue Apr 19, 2023 · 5 comments

Comments

@rrousselGit
Copy link

Hello!

It appears that there are currently no way of excluding certain matches.
For example, a glob may want to match against foo.dart but reject foo_test.dart

The Glob syntax seems to support *[!_test].dart, but this does not appear to be supported by this package.

@vrnvorona
Copy link

vrnvorona commented May 24, 2023

same for !(pattern) globs. You can't really use library which calls itself glob but doesn't work like one, it's misleading.

@hyiso
Copy link

hyiso commented Jan 13, 2024

Same problem when using package lint_staged which use glob to match patterns

@erick-ciudaz
Copy link

with the same problem

@ManuelRauber
Copy link

Jepp. Same with generated files like a.dart and a.g.dart. I want to format a.dart but leave a.g.dart as it was generated.

@takumma
Copy link

takumma commented Jan 21, 2025

I think you can use ! and ^ like *[!_test].dart or **[^.g].dart.

I found the following in the README, and also saw such an implementation in the code :)

If it starts with ^ or !, the construction will instead match all characters not mentioned. For example, test[^a-z].dart will match test1.dart but not testa.dart.

@devoncarew devoncarew transferred this issue from dart-lang/glob Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants