biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
https://biomejs.dev
Apache License 2.0
12.84k stars 400 forks source link

📎 Support `{a,b}` glob pattern syntax for includes/excludes #2986

Open dyc3 opened 1 month ago

dyc3 commented 1 month ago

Summary

We want to support {a,b} pattern matching syntax for includes and excludes. It will allow us to more comprehensively support all the patterns that the Editorconfig spec defines (although not completely).

Specifically, this syntax is to indicate that in the pattern {a,b}, there is a comma separated list of patterns that are applicable in that position.

ematipico commented 1 month ago

The pattern logic is an internal fork of glob: https://docs.rs/glob/latest/glob/struct.pattern.html

Other than that, unfortunately I can't give you more information, we will have to figure it out ourselves.

Regarding the recursion, I think it's safe to assume that we don't want to support nested patterns deeper than one level:

Even other libraries that offer Unix glob parsing and matching don't support nested patterns.

If we set this as a goal, I think recursion isn't needed. Or we could use it, and it should not put too much memory pressure.

Sec-ant commented 1 month ago

FYI, there're some pre-discussions here: #2620

Conaclos commented 1 month ago

I think we can set this task for Biome 2.0 because this will require a breaking change.

ematipico commented 1 month ago

@Conaclos why was this PR merged if the milestone is set for Biome 2.0?

eMerzh commented 2 weeks ago

does this still need to be open?

dyc3 commented 2 weeks ago

Yes. The code for this is already implemented, but it's placed behind a flag. This issue should be closed when that flag is removed in biome 2.0.