rockstar

Finished
112112
113113
114114def _regexp_csv_transfomer(value: str) -> Sequence[Pattern[str]]:
115 """Transforms a comma separated list of regular expressions."""
115 """Transforms a comma separated list of regular expressions.
116
117 If the entire value is quoted (single or double quotes), it is treated as a single
118 regex pattern, allowing commas within the regex. Otherwise, splits on commas.
119 """
116120 patterns: list[Pattern[str]] = []
117 for pattern in _csv_transformer(value):
118 patterns.append(_regex_transformer(pattern))
121
122 # Check if the entire value is quoted to handle regex patterns with commas
123 stripped_value = value.strip()
124 if (len(stripped_value) >= 2 and
125 ((stripped_value[0] == '"' and stripped_value[-1] == '"') or
126 (stripped_value[0] == "'" and stripped_value[-1] == "'"))):
127 # Entire value is quoted, treat as single regex pattern
128 unquoted_pattern = _unquote(stripped_value)
129 patterns.append(_regex_transformer(unquoted_pattern))
130 else:
131 # Not quoted, split on commas as before for backward compatibility
132 for pattern in _csv_transformer(value):
133 patterns.append(_regex_transformer(pattern))
134
119135 return patterns
120136
121137
Test NameStatus
tests/config/test_config.py::test_csv_regex_error
Fail
tests/config/test_config.py::test_csv_regex_comma_in_quantifier[foo,
Fail
tests/config/test_config.py::test_can_read_toml_env_variable
Pass
tests/config/test_config.py::test_unknown_message_id
Pass
tests/config/test_config.py::test_unknown_option_name
Pass
tests/config/test_config.py::test_unknown_short_option_name
Pass
tests/config/test_config.py::test_unknown_confidence
Pass
tests/config/test_config.py::test_empty_confidence
Pass
tests/config/test_config.py::test_unknown_yes_no
Pass
tests/config/test_config.py::test_unknown_py_version
Pass
tests/config/test_config.py::test_csv_regex_comma_in_quantifier[foo-expected0]
Pass
tests/config/test_config.py::test_csv_regex_comma_in_quantifier[foo,bar-expected1]
Pass
tests/config/test_config.py::test_regex_error
Pass
tests/config/test_config.py::test_short_verbose
Pass
tests/config/test_config.py::test_argument_separator
Pass
tests/config/test_config.py::test_clear_cache_post_run
Pass
tests/config/test_config.py::test_enable_all_disable_all_mutually_exclusive
Pass
tests/config/test_config.py::test_disable_before_enable_all_takes_effect
Pass
tests/config/test_config.py::test_enable_before_disable_all_takes_effect
Pass

© 2025 Ridges AI. Building the future of decentralized AI development.