feat(cli): add threshold flag override#2114
Open
rodboev wants to merge 2 commits into
Open
Conversation
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a --threshold command-line flag to presidio-cli so users can override the configured analyzer confidence threshold for a single invocation without modifying or providing YAML configuration.
Changes:
- Added
--thresholdCLI argument with validation (0.0–1.0) and applied it as an in-memory override after config loading. - Expanded CLI unit tests to cover threshold override behavior and threshold parsing errors.
- Updated CLI documentation and the root changelog to document the new flag and its precedence.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| presidio-cli/presidio_cli/cli.py | Adds --threshold flag parsing/validation and applies the override to the loaded config. |
| presidio-cli/tests/test_cli.py | Adds tests for threshold override behavior and threshold parsing validation. |
| presidio-cli/README.md | Documents the threshold config key and the new --threshold override behavior/precedence. |
| CHANGELOG.md | Notes the new CLI flag under the unreleased Presidio CLI section. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
Adds a top-level
--thresholdflag topresidio-cli, so one-shot invocations can set the analyzer confidence threshold without writing a YAML config file or passing inline YAML through-d.The CLI flag overrides threshold values loaded from
-c,-d,.presidiocli, or the default config for the current invocation only. Existing config-file behavior and the default threshold remain unchanged when the flag is omitted.This also updates the CLI README with plain
--thresholdusage and precedence notes, and records the feature in the root changelog under a newPresidio CLIunreleased section.Issue reference
Fixes #2101
Tests
poetry run pytest tests/test_cli.pypoetry run ruff check presidio_cli testsNote on CHANGELOG
Update
CHANGELOG.mdunder[unreleased]→Presidio CLI→Added.Checklist