feat: enhance function listing with category and description filters#1615
feat: enhance function listing with category and description filters#1615Gijsreyn wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the dsc function list CLI to support filtering functions by metadata (category and description), addressing the UX request in #1581 by avoiding the need to post-filter results in a shell pipeline.
Changes:
- Add
--category/-csupport (repeatable; treated as an AND filter) fordsc function list. - Add
--description/-dsupport for case-insensitive wildcard matching against function descriptions. - Add localization strings and Pester coverage for category/description filtering and combined filters.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lib/dsc-lib/src/functions/mod.rs | Adds FunctionCategory::ALL and FromStr parsing to enable CLI category argument parsing with a localized invalid-category error. |
| lib/dsc-lib/locales/en-us.toml | Adds the localized functions.invalidCategory message used by FunctionCategory::FromStr. |
| dsc/src/args.rs | Extends the function list subcommand args with --category and --description. |
| dsc/src/subcommand.rs | Implements category AND-filtering and description wildcard filtering in list_functions. |
| dsc/locales/en-us.toml | Adds localized help text for the new args and a new invalid-description-filter error string. |
| dsc/tests/dsc_function_list.tests.ps1 | Adds Pester tests for category filtering, description filtering, and combined filters. |
|
@SteveL-MSFT, has something recently changed on the workflows that it instantly errors out? |
Let me look into this, code coverage reporting was added |
|
Ok, I think this should fix CI #1619 Basically, the PR broke the build, but the workflow is not reporting that correctly. Look at the build checks and expand the build item to see the actual error that needs to be fixed. |
PR Summary
Adds
--categoryand--descriptionfiltering options to thedsc function listcommand:-c/--category— filter by function category; can be specified multiple times to require all categories (AND filter).-d/--description— case-insensitive search within the function description, supports wildcards (*,?).PR Context
Fixes #1581