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

Expand globs in simple script arguments #197

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

HexDecimal
Copy link
Collaborator

Expands globs in simple cases using the following rules:

  • If any path is a existing folder or file then it's used as-is, even if it can be used as a glob pattern. This is supposed to ensure that there's no surprises or regressions.
  • Otherwise the glob is expanded with Python's glob module. If this results in no files then it raises FileNotFoundError.

Added tests for this.

Some commands are too complex for this workaround. This only applies to commands which takes one list of arguments and not commands with more complex positional parameters such as delocate-fuse and delocate-patch.

I'd rather not merge this PR until it's reviewed.

Fixes #71

Copy link

codecov bot commented Nov 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a17dc82) 96.40% compared to head (62f0a50) 96.45%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #197      +/-   ##
==========================================
+ Coverage   96.40%   96.45%   +0.04%     
==========================================
  Files          15       15              
  Lines        1169     1184      +15     
==========================================
+ Hits         1127     1142      +15     
  Misses         42       42              

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

VSCode was automatically updating this option
Add glob script tests

Some commands are too complex for this workaround
@HexDecimal
Copy link
Collaborator Author

After some more thought and better tests I've decided that this shouldn't cause issues when merged. Preferring literal names to glob expansion should avoid theoretical regressions, and this PR is very easy to revert if any unexpected edge cases do appear.

@HexDecimal HexDecimal merged commit 8648115 into matthew-brett:master Dec 12, 2023
15 checks passed
@HexDecimal HexDecimal deleted the fix-71 branch December 12, 2023 10:40
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.

When delocate is called with a non-expanded wildcard path it produces wrong result
1 participant