Reject keywords that normalize to empty - #84
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7772d9d74e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @field_validator("keywords") | ||
| @classmethod | ||
| def reject_empty_sanitized_keywords(cls, keywords: list[str]) -> list[str]: | ||
| """Reject keywords that become empty after sanitization.""" |
There was a problem hiding this comment.
Add Google-style sections to the validator docstring
Expand this new validator's one-line docstring with Args:, Returns:, and Raises: sections, including the ValueError condition. The repository explicitly requires these sections for every function and requires review deviations to be flagged.
AGENTS.md reference: AGENTS.md:L87-L90
Useful? React with 👍 / 👎.
7772d9d to
9f41773
Compare
Summary
Why
A configured keyword such as ... was normalized to an empty string. The resulting empty regex alternative matched every input, so benign text triggered the keyword filter. The inherited competitor configuration had the same failure mode.
Failing configuration validation makes the error explicit and prevents a match-all pattern from reaching runtime.
Testing