A single condition for matching.
| 14 | |
| 15 | @dataclass |
| 16 | class Condition: |
| 17 | """A single condition for matching.""" |
| 18 | field: str # "command", "new_text", "old_text", "file_path", etc. |
| 19 | operator: str # "regex_match", "contains", "equals", etc. |
| 20 | pattern: str # Pattern to match |
| 21 | |
| 22 | @classmethod |
| 23 | def from_dict(cls, data: Dict[str, Any]) -> 'Condition': |
| 24 | """Create Condition from dict.""" |
| 25 | return cls( |
| 26 | field=data.get('field', ''), |
| 27 | operator=data.get('operator', 'regex_match'), |
| 28 | pattern=data.get('pattern', '') |
| 29 | ) |
| 30 | |
| 31 | |
| 32 | @dataclass |
no outgoing calls
no test coverage detected