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

feat(configuration): add support for {a,b} glob patterns, gated behind an internal flag #2989

Merged
merged 1 commit into from
May 28, 2024

Conversation

dyc3
Copy link
Contributor

@dyc3 dyc3 commented May 26, 2024

Summary

This implements the "at least one of these" syntax for glob patterns as discussed in #2986. The intention is to bring our glob pattern parsing closer to what the Editorconfig spec allows for, so that we can have better Editorconfig support.

This is possibly a breaking change since the { and } characters now have special meaning, and as such it would probably be better to leave this for biome 2.0. It's likely this PR will get stale in that time, but at minimum the test cases in this PR could remain useful to have.

closes #2986

Test Plan

added tests

@github-actions github-actions bot added the A-Project Area: project label May 26, 2024
@Conaclos
Copy link
Member

One idea: We could add a boolean field in Pattern that gates the {} alternation. This field could be enabled only for Patterns created from editorconfig patterns. This could avoid the breaking change.

@dyc3
Copy link
Contributor Author

dyc3 commented May 27, 2024

I like that. It would allow us to unblock #2971 without modifying the repo's .editorconfig. I'll have this PR updated by tomorrow morning.

@dyc3 dyc3 changed the title feat(configuration): add support for {a,b} glob patterns feat(configuration): add support for {a,b} glob patterns, gated behind an internal flag May 28, 2024
@dyc3
Copy link
Contributor Author

dyc3 commented May 28, 2024

Updated. I've intentionally left out the changes required for editorconfig patterns actually getting treated properly using this new flag because I believe those changes will be a bit more complicated.

@dyc3 dyc3 marked this pull request as ready for review May 28, 2024 11:14
@Conaclos Conaclos merged commit a126fb7 into biomejs:main May 28, 2024
11 checks passed
@dyc3 dyc3 deleted the curly-globs branch May 28, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Project Area: project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📎 Support {a,b} glob pattern syntax for includes/excludes
2 participants