fix(checks): reject empty text matchers 馃馃馃馃 - #2786
Closed
mikemikimike wants to merge 8 commits into
Closed
Conversation
Member
|
Hey @mikemikimike Thanks for the PR, it only partially fixes #2785 The case with empty string is fine, it now raises. However the following case still pass where it should fail:
|
Author
|
Addressed in the current head |
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.
Description
Reject empty keyword and pattern values before text matching. This prevents Python substring matching and regex search from treating empty matchers as universal matches. The shared validation path covers both direct values and values resolved from a trace.
Related Issue
Fixes #2785
Type of Change
Coding agents
I have read
AUTONOMOUS.mdand followed its PR requirements.Checklist
CODE_OF_CONDUCT.mddocument.CONTRIBUTING.mdguide.pyproject.tomlwas not modified.Validation
uv run --frozen --directory libs/giskard-checks pytest tests/builtin/test_string_matching.py tests/builtin/test_regex_matching.py -m "not functional" -q(63 passed)uv run --frozen ruff format --check .uv run --frozen ruff check .uv tool run basedpyright --level error libs/giskard-checks/src libs/giskard-checks/testsgit diff --checkThe full
giskard-checksunit suite ran 935 passed / 16 skipped / 3 failed. The failures are existing RegoPolicy tests that requireceline-regorus; that optional dependency intentionally has no Windows wheel, so it cannot be installed on this host.