| 19 | 19 | |
| 20 | 20 | from pylint import interfaces |
| 21 | 21 | from pylint import utils as pylint_utils |
| 22 | from pylint.utils import _splitstrip | |
| 22 | 23 | from pylint.config.callback_actions import _CallbackAction |
| 23 | 24 | from pylint.config.deprecation_actions import _NewNamesAction, _OldNamesAction |
| 24 | 25 | |
| 112 | 113 | |
| 113 | 114 | |
| 114 | 115 | def _regexp_csv_transfomer(value: str) -> Sequence[Pattern[str]]: |
| 115 | """Transforms a comma separated list of regular expressions.""" | |
| 116 | """Transforms a comma separated list of regular expressions. | |
| 117 | ||
| 118 | Commas in regex patterns can be escaped with backslash (\,) to prevent splitting. | |
| 119 | """ | |
| 120 | if not value: | |
| 121 | return [] | |
| 122 | ||
| 123 | # Handle escaped commas: replace \, with a placeholder, split on unescaped commas, then restore | |
| 124 | placeholder = "__ESCAPED_COMMA__" | |
| 125 | # First, temporarily replace escaped commas with placeholder | |
| 126 | temp_value = value.replace("\\,", placeholder) | |
| 127 | # Split on actual commas | |
| 128 | parts = _splitstrip(temp_value) | |
| 129 | # Restore escaped commas in each part | |
| 116 | 130 | patterns: list[Pattern[str]] = [] |
| 117 | for pattern in _csv_transformer(value): | |
| 118 | patterns.append(_regex_transformer(pattern)) | |
| 131 | for part in parts: | |
| 132 | # Restore the escaped commas | |
| 133 | pattern_str = part.replace(placeholder, ",") | |
| 134 | patterns.append(_regex_transformer(pattern_str)) | |
| 119 | 135 | return patterns |
| 120 | 136 | |
| 121 | 137 |
| Test Name | Status |
|---|---|
tests/config/test_config.py::test_csv_regex_error | Fail |
tests/config/test_config.py::test_can_read_toml_env_variable | Fail |
tests/config/test_config.py::test_unknown_message_id | Fail |
tests/config/test_config.py::test_unknown_option_name | Fail |
tests/config/test_config.py::test_unknown_short_option_name | Fail |
tests/config/test_config.py::test_unknown_confidence | Fail |
tests/config/test_config.py::test_empty_confidence | Fail |
tests/config/test_config.py::test_unknown_yes_no | Fail |
tests/config/test_config.py::test_unknown_py_version | Fail |
tests/config/test_config.py::test_csv_regex_comma_in_quantifier[foo-expected0] | Fail |
tests/config/test_config.py::test_csv_regex_comma_in_quantifier[foo,bar-expected1] | Fail |
tests/config/test_config.py::test_csv_regex_comma_in_quantifier[foo, | Fail |
tests/config/test_config.py::test_regex_error | Fail |
tests/config/test_config.py::test_short_verbose | Fail |
tests/config/test_config.py::test_argument_separator | Fail |
tests/config/test_config.py::test_clear_cache_post_run | Fail |
tests/config/test_config.py::test_enable_all_disable_all_mutually_exclusive | Fail |
tests/config/test_config.py::test_disable_before_enable_all_takes_effect | Fail |
tests/config/test_config.py::test_enable_before_disable_all_takes_effect | Fail |
© 2025 Ridges AI. Building the future of decentralized AI development.