Skip to content

Commit 5bd6543

Browse files
committed
squish regexes together
1 parent 7f60f74 commit 5bd6543

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/python/pants/backend/python/dependency_inference/default_module_mapping.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,10 @@ def two_groups_hyphens_two_replacements_with_suffix(
189189
}
190190

191191
DEFAULT_TYPE_STUB_MODULE_PATTERN_MAPPING: Dict[re.Pattern, List[Callable[[Match[str]], str]]] = {
192-
re.compile(r"""^stubs_(.+)"""): [first_group_hyphen_to_underscore],
193-
re.compile(r"""^types_(.+)"""): [first_group_hyphen_to_underscore],
194-
re.compile(r"""^stubs-(.+)"""): [first_group_hyphen_to_underscore],
195-
re.compile(r"""^types-(.+)"""): [first_group_hyphen_to_underscore],
196-
re.compile(r"""^(.+)_stubs"""): [first_group_hyphen_to_underscore],
197-
re.compile(r"""^(.+)_types"""): [first_group_hyphen_to_underscore],
198-
re.compile(r"""^(.+)-stubs"""): [first_group_hyphen_to_underscore],
199-
re.compile(r"""^(.+)-types"""): [first_group_hyphen_to_underscore],
192+
re.compile(r"""^stubs[_-](.+)"""): [first_group_hyphen_to_underscore],
193+
re.compile(r"""^types[_-](.+)"""): [first_group_hyphen_to_underscore],
194+
re.compile(r"""^(.+)[_-]stubs"""): [first_group_hyphen_to_underscore],
195+
re.compile(r"""^(.+)[_-]types"""): [first_group_hyphen_to_underscore],
200196
}
201197

202198
DEFAULT_TYPE_STUB_MODULE_MAPPING: Dict[str, Tuple[str, ...]] = {

0 commit comments

Comments
 (0)