Skip to content

Implement file globbing support #186

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

simaoafonso-pwt
Copy link
Contributor

This is tested locally in tcsh and bash, zsh is untested.

There should not be any regressions, the test suite passes. We can bikeshed the name.

I did not add support for globbing folders, this doesn't seem to be supported in zsh. I also did not implement the sub-folder support (that is, showing all folders on the file glob completion, so you can descend the hierarchy) since this is only supported in bash. I accept this feature might be required, and are willing to implement it.


This is based on https://github.com/iterative/shtab/blob/main/examples/customcomplete.py#L11-L22.

For zsh, https://zsh-manual.netlify.app/completion-system mentions there's no support for globbing folders.

Fix #124 #69

Move existing code to a common function.
This is tested locally in tcsh and bash, zsh is untested.

There should not be any regressions, the test suite passes.
Copy link

codecov bot commented May 5, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 9 lines in your changes missing coverage. Please review.

Project coverage is 88.20%. Comparing base (1d7a36b) to head (201dcc2).

Files with missing lines Patch % Lines
shtab/__init__.py 66.66% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #186      +/-   ##
==========================================
- Coverage   88.88%   88.20%   -0.69%     
==========================================
  Files           3        3              
  Lines         360      373      +13     
==========================================
+ Hits          320      329       +9     
- Misses         40       44       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] Can it provide a function to generate code like <https://github.com/iterative/shtab/blob/main/examples/customcomplete.py#L11-L22>
1 participant