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

Shared extractor: support file path globs #13969

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

hmac
Copy link
Contributor

@hmac hmac commented Aug 15, 2023

Update the tree-sitter extractor to support file globs. This replaces the existing file_extensions field with a file_globs field, which supports UNIX style glob patterns powered by the globset crate.

This allows files with no extension (e.g. Dockerfiles) to be extracted
by specifying a glob such as *Dockerfile.

One surprising aspect of this change is that the globs match against the
whole path, rather than just the file name. I'm not sure if this is an issue we should work around, or if it's OK.

@aibaars I'd be interested in your thoughts on this.

Fixes #13964

Replace the `file_extensions` field with `file_globs`, which supports
UNIX style glob patterns powered by the `globset` crate.

This allows files with no extension (e.g. Dockerfiles) to be extracted,
by specifying a glob such as `*Dockerfile`.

One surprising aspect of this change is that the globs match against the
whole path, rather than just the file name.

This is a breaking change.
@hmac hmac marked this pull request as ready for review August 16, 2023 15:11
@hmac hmac requested a review from a team as a code owner August 16, 2023 15:11
@hmac hmac requested a review from aibaars August 18, 2023 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tree-Sitter Shared Extractor doesn't support extension-less files
1 participant