-
Notifications
You must be signed in to change notification settings - Fork 774
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
Add the --pattern CLI argument for file system globbing #16456
base: main
Are you sure you want to change the base?
Conversation
Test this change out locally with the following install scripts (Action run 13534805277) VSCode
Azure CLI
|
8951597
to
e24e965
Compare
Dotnet Test Results 78 files - 39 78 suites - 39 31m 6s ⏱️ - 22m 13s Results for commit 3d1d1b4. ± Comparison against base commit 70068c2. This pull request removes 1796 and adds 683 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Should we consider allowing globs such as "**/*.bicep" directly in the -f parameter? I asked Copilot, and it could only find the following similar usage, --pattern (but note that it's not true glob patterns, and blob paths are not file paths): One possible ambiguity case is "file[1].cs". And supporting it with "-f" users would need to make sure to put pattern in double quotes. Sounds like the explicit approach probably is safer. |
It doesn't seem like
It looks like To handle both absolute and relative file glob patterns, I think we can follow these steps:
|
@StephenWeatherford, @shenglol thanks for the feedback and detailed notes! I don't have a super strong opinion either way - will plan to bring this up in Bicep Discussions. Option 1: Introduce new
Option 2: Reuse the current "file path" argument
Other notes:
Notes from discussion on 2/24:
|
5984e70
to
3d1d1b4
Compare
For the following CLI commands:
build
build-params
format
lint
restore
Adds the following optional argument:
--pattern <pattern>
: Selects all files matching the specified glob pattern.This is implemented using the .NET built-in file globbing support: https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.filesystemglobbing
Closes #246
Closes #1285
Note that while various workarounds have been provided in #1285, using bash or powershell loops, they are very slow because of .NET cold-start delays.