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
15.6k stars 486 forks source link

refactor(retsricted_glob): add `matches_directory_with_exceptions` #4608

Closed Conaclos closed 1 week ago

Conaclos commented 1 week ago

Summary

Add matches_directory_with_exceptions for matching a path against a list of globs with exceptions. This will allow us to implement a file crawler. The current implementation has the same limitations as Git: only directly in exception are doesn't match. Encapsulating this in a method, will allow us to improve its implementation if one day we switch to another glob library that supports prefix matching.

Test Plan

I added doc tests. CI must pass.

codspeed-hq[bot] commented 1 week ago

CodSpeed Performance Report

Merging #4608 will not alter performance

Comparing conaclos/restricted-glob-matches_directory_with_exceptions (7620a7d) with main (228393a)

Summary

✅ 99 untouched benchmarks